* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-y: auto;
}

/* ==================== PAGE D'ACCUEIL ==================== */

.home-page {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    background-attachment: fixed;
    height: 100vh;
    overflow: hidden;
}

.home-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
}

/* Section héro */
.hero-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: clamp(16px, 3vh, 40px) clamp(20px, 4vw, 60px);
    position: relative;
    overflow: hidden;
}

.hero-title {
    color: white;
    font-size: clamp(1.1rem, 2.5vw, 2.2rem);
    font-weight: 700;
    text-align: left;
    margin-bottom: clamp(16px, 3vh, 40px);
    letter-spacing: 0.5px;
    text-shadow: none;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: 100%;
    gap: clamp(24px, 5vw, 70px);
    min-height: 0;
    flex: 1;
}

.hero-left {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 0 0 auto;
    max-width: 380px;
}

.hero-features {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(12px, 3vh, 50px);
    flex: 0 0 auto;
}

.feature-item {
    text-align: left;
}

.feature-text {
    color: white;
    font-size: clamp(0.95rem, 1.8vw, 1.8rem);
    font-weight: 400;
    text-shadow: none;
    line-height: 1.4;
    max-width: 320px;
}

.feature-icon {
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.france-map-container {
    flex: 0 1 auto;
    max-width: 650px;
    max-height: 100%;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.2));
    overflow: hidden;
    display: flex;
    align-items: center;
}

.map-wrapper {
    position: relative;
    width: 100%;
    height: auto;
}

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

.evreux-rond {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 45%;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
    pointer-events: none;
}

.evreux-marker {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
}

.marker-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Séparateur */
.section-divider {
    width: 95%;
    max-width: 100%;
    height: 2px;
    background: white;
    margin: 0 auto;
    flex-shrink: 0;
}

/* Section CTA */
.cta-section {
    padding: clamp(16px, 2.5vh, 50px) 20px clamp(20px, 3vh, 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cta-title {
    color: white;
    font-size: clamp(1rem, 2vw, 2rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: clamp(16px, 2.5vh, 40px);
    letter-spacing: 1px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
}

.button-group {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 16px 50px;
    font-size: 1.4rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 3px solid white;
    min-width: 300px;
    box-shadow: none;
    background: transparent;
    color: white;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.cursor-icon {
    width: 30px;
    height: 30px;
    transform: rotate(0deg);
}

/* ==================== BOUTON RETOUR QUIZ ==================== */

.btn-retour-quiz {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(6px);
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.btn-retour-quiz:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
}

/* ==================== PAGE QUIZ ==================== */

/* Styles spécifiques pour la page du quiz */
body:not(.home-page) {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

.container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

h1 {
    color: white;
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 2rem);
    margin: 0;
    padding: clamp(8px, 1.5vh, 15px) 10px clamp(4px, 0.8vh, 5px);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    z-index: 1000;
    flex-shrink: 0;
}

.instruction {
    color: white;
    text-align: center;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    margin: 0;
    padding: 0 10px clamp(6px, 1.2vh, 15px);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
    z-index: 1000;
    flex-shrink: 0;
}

#map-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: clamp(8px, 1.5vh, 20px);
    position: relative;
    overflow: hidden;
}

#map-image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
}

#france-map-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    width: auto;
    height: auto;
    filter: brightness(0) invert(1) drop-shadow(0 8px 25px rgba(0, 0, 0, 0.3));
}

#markers-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.city-marker {
    position: absolute;
    width: 40px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translate(-50%, -100%);
    pointer-events: all;
}

/* Pin rouge style géolocalisation */
.city-marker::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    background: #EA4335;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    left: 0;
    top: 0;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

/* Cercle blanc */
.city-marker::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    left: 50%;
    top: 9px;
    transform: translateX(-50%);
    z-index: 1;
}

/* Point rouge central */
.marker-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #B71C1C;
    border-radius: 50%;
    left: 50%;
    top: 13px;
    transform: translateX(-50%);
    z-index: 2;
    pointer-events: none;
}

/* Label nom de ville */
.marker-label {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 6px rgba(0,0,0,0.6);
    pointer-events: none;
    letter-spacing: 0.3px;
}

.city-marker {
    display: block;
}

.city-marker:before {
    z-index: 0;
}

/* Animation au survol */
.city-marker:hover {
    transform: translate(-50%, -105%) scale(1.1);
}

.city-marker:hover::before {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Marqueur correct (doré) */
.city-marker.correct::before {
    background: #FBBC04;
    animation: locationPulse 0.5s ease-out;
}

.city-marker.correct .marker-dot {
    background: #F57F17;
}

/* Marqueur incorrect (vert) */
.city-marker.incorrect::before {
    background: #34A853;
}

.city-marker.incorrect .marker-dot {
    background: #1B5E20;
}

.city-marker.incorrect {
    pointer-events: none;
}

/* Marqueur qui clignote en vert (révélation d'Évreux) */
.city-marker.blink-green::before {
    animation: blinkGreen 0.8s ease-in-out infinite;
}

.city-marker.blink-green .marker-dot {
    background: #1B5E20;
}

@keyframes blinkGreen {
    0% { background: #34A853; }
    50% { background: #66bb6a; }
    100% { background: #34A853; }
}

@keyframes locationPulse {
    0% { 
        transform: rotate(-45deg) scale(1);
    }
    50% { 
        transform: rotate(-45deg) scale(1.2);
    }
    100% { 
        transform: rotate(-45deg) scale(1);
    }
}

/* Animation de vibration */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.shake-animation {
    animation: shake 0.5s;
}

/* Message d'erreur style comic */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    transition: opacity 0.3s;
}

.error-message.hidden {
    display: none;
    opacity: 0;
}

.comic-bubble {
    background: white;
    border: 6px solid black;
    border-radius: 30px;
    padding: 40px 60px;
    position: relative;
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.5);
    transform: rotate(-2deg);
}

.success-bubble {
    background: #ffeb3b;
    border-color: #f57f17;
    transform: rotate(2deg);
    animation: successPop 0.5s ease-out;
}

@keyframes successPop {
    0% { transform: scale(0) rotate(2deg); }
    50% { transform: scale(1.1) rotate(2deg); }
    100% { transform: scale(1) rotate(2deg); }
}

.comic-bubble::before {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 30px solid black;
}

.comic-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 25px solid white;
}

.comic-text {
    font-size: 5rem;
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.comic-subtext {
    font-size: 1.8rem;
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.retry {
    font-size: 1.2rem;
    color: #333;
    text-align: center;
}

/* Message de succès */
.success-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    transition: opacity 0.3s;
}

.success-message.hidden {
    display: none;
    opacity: 0;
}

.comic-text-success {
    font-size: 5rem;
    color: #2e7d32;
    font-weight: bold;
    text-align: center;
    text-shadow: 4px 4px 0px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.comic-subtext-success {
    font-size: 1.8rem;
    color: #2e7d32;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.congrats {
    font-size: 1.2rem;
    color: #1b5e20;
    text-align: center;
}

.evreux-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}

/* Slideshow */
.slideshow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.slideshow.hidden {
    display: none;
}

.slideshow-header {
    width: 100%;
    max-width: 95vw;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 20px;
}

.slideshow-header h2 {
    color: white;
    font-size: 2rem;
}

.close-btn {
    background: #ff4757;
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.close-btn:hover {
    transform: scale(1.1);
    background: #ff3838;
}

.slideshow-container {
    position: relative;
    width: 95vw;
    max-width: 1600px;
    height: 85vh;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.slide {
    display: none;
    width: 100%;
    height: 100%;
    position: relative;
}

.slide.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 25px;
    font-size: 1.6rem;
    text-align: center;
    font-weight: 500;
}

.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    color: black;
    border: none;
    font-size: 2.5rem;
    padding: 20px 25px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: bold;
    z-index: 10;
}

.prev:hover, .next:hover {
    background: rgba(255, 255, 255, 1);
}

.prev {
    left: 15px;
    border-radius: 0 8px 8px 0;
}

.next {
    right: 15px;
    border-radius: 8px 0 0 8px;
}

.slide-indicators {
    margin-top: 20px;
    text-align: center;
}

.dot {
    height: 18px;
    width: 18px;
    margin: 0 8px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.dot:hover {
    background-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background-color: white;
    transform: scale(1.3);
}

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

/* --- Tablette (≤ 900px) --- */
@media (max-width: 900px) {
    .hero-section {
        padding: 30px 30px;
    }
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 36px;
    }
    .hero-content {
        gap: 36px;
    }
    .feature-text {
        font-size: 1.3rem;
    }
    .france-map-container {
        max-width: 420px;
    }
    .cta-title {
        font-size: 1.6rem;
    }
    .cta-button {
        font-size: 1.1rem;
        padding: 14px 32px;
        min-width: 240px;
    }
}

/* --- Mobile large (≤ 768px) --- */
@media (max-width: 768px) {
    /* Accueil - layout colonne */
    .home-page, .home-container {
        height: 100dvh;
    }
    .hero-section {
        align-items: center;
        justify-content: center;
    }
    .hero-left {
        align-items: center;
        max-width: 100%;
        text-align: center;
    }
    .hero-title {
        text-align: center;
    }
    .hero-content {
        flex-direction: column;
        align-items: center;
    }
    .hero-features {
        align-items: center;
        width: 100%;
    }
    .feature-text {
        text-align: center;
        max-width: 100%;
    }
    .france-map-container {
        max-width: 85%;
        flex: 0 1 auto;
    }

    /* Quiz */
    #map-container {
        padding: 8px;
    }
    #france-map-img {
        max-width: 92%;
    }

    /* Vidéo player */
    .slideshow {
        padding: 10px;
    }
    .slideshow-container {
        width: 100%;
        height: 75vh;
        border-radius: 10px;
    }
    .slideshow-header {
        margin-bottom: 12px;
    }
    .caption {
        font-size: 1rem;
        padding: 12px;
    }
    .prev, .next {
        font-size: 1.8rem;
        padding: 12px 14px;
    }
    .slide-indicators {
        margin-top: 12px;
    }
    .dot {
        width: 12px;
        height: 12px;
        margin: 0 5px;
    }

    /* Bulles quiz */
    .comic-bubble {
        padding: 24px 36px;
    }
    .comic-text, .comic-text-success {
        font-size: 3rem;
    }
    .comic-subtext, .comic-subtext-success {
        font-size: 1.2rem;
    }
}

/* --- Mobile petit (≤ 480px) --- */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.15rem;
    }
    .feature-text {
        font-size: 0.9rem;
    }
    .cta-button {
        font-size: 0.9rem;
        min-width: 180px;
        padding: 12px 20px;
    }
    .cta-title {
        font-size: 1rem;
    }
    .comic-bubble {
        padding: 18px 24px;
    }
    .comic-text, .comic-text-success {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }

    .cta-title {
        font-size: 1.2rem;
    }

    .cta-button {
        padding: 12px 25px;
        font-size: 1rem;
        min-width: 200px;
    }

    .feature-text {
        font-size: 1rem;
    }
    
    .city-marker {
        width: 21px;
        height: 34px;
    }
    
    .city-marker::before {
        width: 21px;
        height: 21px;
        border-width: 2px;
    }
    
    .city-marker::after {
        width: 6px;
        height: 6px;
        top: 5px;
    }
    
    .comic-bubble {
        padding: 30px 40px;
    }
}
