/* --- VARIABLES --- */
:root {
    --color-plaine: #8ec941;
    --color-desert: #FFF895;
    --color-foret: #494f2c;
    --color-neige: #affff7;
    --color-grotte: #74482f;
    --color-enfer: #771110;

    --primary: #4CAF50;
    --secondary: #333;
    --dark: #1a1a1a;
    --light: #f4f4f4;
    --text: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Roboto', sans-serif; line-height: 1.6; color: var(--text); background-color: var(--light); scroll-behavior: smooth; }
h1, h2, h3, .logo, .key { font-family: 'Press Start 2P', cursive; text-transform: uppercase; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* --- NAVBAR --- */
.navbar { background: rgba(0, 0, 0, 0.95); color: #fff; height: 70px; position: fixed; width: 100%; top: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo { font-size: 1.2rem; letter-spacing: 2px; }
.dot { color: var(--primary); }
.nav-links { display: flex; }
.nav-links li { margin-left: 25px; }
.nav-links a:hover { color: var(--primary); transition: 0.3s; }
.btn-nav { background: var(--primary); padding: 8px 15px; border-radius: 5px; }
.burger { display: none; cursor: pointer; }
.burger div { width: 25px; height: 3px; background-color: white; margin: 5px; }

/* --- HERO (Image perso) --- */
.hero {
    height: 100vh;
    /* Met ton image 'hero_bg.png' dans assets pour voir ton jeu en fond */
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('assets/hero_bg.png');
    background-size: cover;
    background-position: center;
    background-color: #222; /* Fallback */
    display: flex; align-items: center; justify-content: center; text-align: center; color: white;
}
.hero h1 { font-size: 2.2rem; margin-bottom: 20px; line-height: 1.4; text-shadow: 3px 3px 0 #000; }
.highlight { color: var(--primary); text-shadow: 2px 2px 0 #000; }
.hero-buttons { margin-top: 30px; display: flex; gap: 20px; justify-content: center; }
.btn { padding: 12px 30px; border-radius: 5px; font-weight: bold; transition: 0.3s; display: inline-block; cursor: pointer; border: none;}
.btn-primary { background: var(--primary); color: white; box-shadow: 0 4px 0 #2E7D32;}
.btn-primary:hover { background: #45a049; transform: translateY(-3px); box-shadow: 0 6px 0 #2E7D32;}
.btn-secondary { border: 2px solid white; color: white; background: transparent; }
.btn-secondary:hover { background: white; color: black; }

/* --- SECTIONS GÉNÉRALES --- */
.section { padding: 80px 0; }
.section-title { text-align: center; font-size: 1.8rem; margin-bottom: 10px; }
.section-subtitle { text-align: center; margin-bottom: 50px; color: #666; }
.section-dark { background: var(--dark); color: white; }
.section-dark .section-subtitle { color: #aaa; }

/* --- FEATURES GRID (CONCEPT) --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; text-align: center; }
.feature-box { padding: 20px; background: white; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.feature-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 15px; }

/* --- REGLES DU JEU (CLAVIER) --- */
.rules-container { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 40px; align-items: center; }
.controls-block { text-align: center; }
.keyboard-layout { margin: 20px 0; display: inline-block; }
.key-row { display: flex; justify-content: center; margin-bottom: 5px; }
.key {
    width: 50px; height: 50px;
    background: #333; border: 2px solid #555; border-bottom: 4px solid #111; border-radius: 8px;
    color: white; font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
    margin: 0 5px; box-shadow: 0 4px 0 #000;
}
.key:active { transform: translateY(4px); box-shadow: 0 0 0 #000; border-bottom: 2px solid #111; }
.control-alt { font-size: 0.9rem; color: #aaa; margin-top: 10px; }
.gameplay-rules ul { text-align: left; }
.gameplay-rules li { margin-bottom: 15px; font-size: 1.1rem; }
.gameplay-rules i { color: var(--primary); margin-right: 10px; }

/* --- BIOMES --- */
.biomes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.biome-card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,0.1); text-align: center; padding-bottom: 10px; transition: transform 0.3s;}
.biome-card:hover { transform: translateY(-5px); }
.biome-color { height: 80px; width: 100%; }
.plaine .biome-color { background: var(--color-plaine); }
.desert .biome-color { background: var(--color-desert); }
.foret .biome-color { background: var(--color-foret); }
.neige .biome-color { background: var(--color-neige); }
.grotte .biome-color { background: var(--color-grotte); }
.enfer .biome-color { background: var(--color-enfer); }
.biome-card h3 { font-size: 0.8rem; margin-top: 10px; color: #333; }

/* --- MEDIA (VIDEO + JEU) --- */
.media-container { display: flex; flex-wrap: wrap; gap: 40px; justify-content: center; align-items: flex-start; }
.video-wrapper, .game-wrapper { flex: 1; min-width: 300px; max-width: 600px; text-align: center; }
.video-wrapper video { width: 100%; border-radius: 8px; border: 2px solid #555; box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.game-instruction { margin-bottom: 10px; font-size: 0.9rem; color: #ccc; }
.media-container h3 { margin-bottom: 20px; color: var(--primary); font-size: 1.2rem; }

/* --- JEU WEB (CANVAS) --- */
.game-container { position: relative; width: 100%; aspect-ratio: 3/2; background-color: #000; border: 4px solid #444; border-radius: 8px; margin: 0 auto; }
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
#gameOverlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.7); display: flex; align-items: center; justify-content: center; z-index: 10; }
#gameOverlay.hidden { display: none; }

/* --- TELECHARGEMENT & GUIDE --- */
.section-cta { background: #2c3e50; color: white; text-align: center; }
.download-options { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; margin-top: 30px; }
.btn-lg { padding: 15px 30px; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.btn-download { background: var(--primary); color: white; }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline:hover { background: var(--primary); color: white; }

/* Guide d'installation */
.install-guide { max-width: 800px; margin: 0 auto; text-align: left; background: rgba(0,0,0,0.2); border-radius: 10px; padding: 10px; border: 1px solid #444; }
.install-guide summary { cursor: pointer; padding: 15px; font-weight: bold; list-style: none; display: flex; align-items: center; gap: 10px; outline: none; }
.install-guide summary:hover { color: var(--primary); }
.guide-content { padding: 20px; border-top: 1px solid #555; background: rgba(0,0,0,0.1); animation: fadeIn 0.5s ease; }
.guide-step { margin-bottom: 20px; }
.guide-step h4 { color: var(--primary); margin-bottom: 10px; font-weight: bold; }
.guide-step code { background: #111; padding: 5px 10px; border-radius: 4px; font-family: monospace; display: block; margin-top: 5px; color: #ddd; }

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

/* --- FOOTER & MOBILE --- */
footer { background: #111; color: #666; padding: 40px 0; text-align: center; }
.footer-links a { color: #ccc; margin-left: 10px; }

@media (max-width: 768px) {
    .nav-links { position: absolute; right: 0; top: 70px; height: 90vh; background: #111; flex-direction: column; width: 70%; transform: translateX(100%); transition: 0.5s; }
    .nav-active { transform: translateX(0); }
    .nav-links li { margin: 20px 0; }
    .burger { display: block; }
    .media-container { flex-direction: column; }
    .download-options { flex-direction: column; align-items: center;}
    .btn-lg { width: 100%; max-width: 300px; justify-content: center; }
}

/* --- CARROUSEL BIOMES --- */
.carousel-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    height: 500px; /* Ajuste selon la hauteur de tes screenshots */
}

.carousel-track-container {
    background: #000;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    cursor: grab; /* Curseur main pour indiquer qu'on peut glisser */
}

.carousel-track-container:active {
    cursor: grabbing;
}

.carousel-track {
    padding: 0;
    margin: 0;
    list-style: none;
    position: relative;
    height: 100%;
    transition: transform 0.4s ease-in-out; /* Animation fluide */
}

.carousel-slide {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Remplit bien la zone */
    display: block;
}

/* Texte par dessus l'image (en bas) */
.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    text-align: center;
}

.slide-content h3 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 1.5rem;
}

/* Boutons Flèches */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.2rem;
    transition: 0.3s;
}

.carousel-btn:hover { background: var(--primary); }
.prev-btn { left: -60px; }
.next-btn { right: -60px; }

/* Points de navigation en bas */
.carousel-nav {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 10px;
}

.carousel-indicator {
    border: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
}

.carousel-indicator.current-indicator {
    background: var(--primary);
}

/* Responsive pour mobile */
@media (max-width: 900px) {
    .carousel-btn { display: none; } /* On cache les flèches sur mobile, on swipe */
    .carousel-container { height: 400px; }
}

/* --- TECH SECTION --- */
.section-tech {
    background: #2c3e50; /* Fond bleu sombre */
    color: white;
}

.section-tech .section-title {
    color: white;
}
.section-tech .section-subtitle {
    color: #ccc;
}

.tech-list {
    max-width: 800px;
    margin: 0 auto 40px auto;
    text-align: left;
}

.tech-list li {
    margin-bottom: 15px;
    font-size: 1.1rem;
    list-style: none;
}

.tech-list i {
    color: var(--primary);
    margin-right: 10px;
}

/* --- BADGES TECHNIQUES --- */
.tech-stack-container {
    margin-top: 30px;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 30px;
}

.tech-stack-container h3 {
    color: var(--primary);
    margin-bottom: 25px;
    font-size: 1.2rem;
}

.tech-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 30px;
    color: #eee;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    cursor: default;
}

.badge i {
    font-size: 1.1rem;
}

/* Effet au survol */
.badge:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
    border-color: var(--primary);
}

/* Couleurs spécifiques (Optionnel) */
.badge.java:hover { background: #E76F00; border-color: #E76F00; }
.badge.git:hover { background: #F05032; border-color: #F05032; }
.badge.html:hover { background: #E34F26; border-color: #E34F26; }
.badge.css:hover { background: #1572B6; border-color: #1572B6; }
.badge.javafx:hover { background: #4285F4; border-color: #4285F4; }