/* Police : on utilise celle déjà installée sur l'appareil (aucune connexion à Google). */

:root {
    --green: #8cff45;
    --background: #101510;
    --panel: #192119;
    --text: #f2f5f0;
    --muted: #a0aa9d;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Barre de choix de la langue (en haut de chaque page) */
.lang-bar {
    background: #0b100b;
    border-bottom: 1px solid #1f2a1f;
    padding: 0 8%;
    font-size: 13px;
}

.lang-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    min-height: 32px;
}

.lang-bar a {
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.lang-bar a:hover {
    color: var(--green);
}

.lang-bar a[aria-current="page"] {
    background: #1e351c;
    color: var(--green);
}

@media (max-width: 550px) {
    .lang-bar { padding: 0 5%; }
}

footer a {
    color: var(--green);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.a-completer {
    background: #4a3a10;
    color: #ffd36a;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.header {
    height: 75px;
    padding: 0 8%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #111911;
    border-bottom: 1px solid #293529;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo {
    font-size: 28px;
    font-weight: 900;
    color: white;
    text-decoration: none;
}

.logo span {
    color: var(--green);
}

.logo-icon {
    width: 36px;
    height: 36px;
    vertical-align: middle;
    margin-right: 8px;
    position: relative;
    top: -3px;
}

nav {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

nav a:hover {
    color: var(--green);
}

.hero {
    min-height: 440px;
    padding: 85px 10%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background:
        radial-gradient(ellipse at 80% 50%, #294c20 0%, transparent 45%),
        linear-gradient(120deg, #152318, #101510);
}

.hero-content {
    max-width: 620px;
}

.tag {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: clamp(42px, 6vw, 70px);
    line-height: 1.08;
    margin-bottom: 20px;
    overflow-wrap: break-word;
    hyphens: auto;
}

.hero h1 span {
    color: var(--green);
}

.hero-content > p:not(.tag) {
    color: var(--muted);
    line-height: 1.8;
    max-width: 500px;
    margin-bottom: 30px;
}

.main-button {
    display: inline-block;
    background: var(--green);
    color: #14200f;
    padding: 15px 23px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    transition: 0.2s;
}

.main-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px #8cff4530;
}

.hero-icon {
    font-size: 130px;
    filter: drop-shadow(0 10px 30px #8cff4530);
}

.section {
    padding: 75px 10%;
}

.section-heading {
    margin-bottom: 30px;
}

.section-heading h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.section-heading > p:not(.tag) {
    color: var(--muted);
}

.categories {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.category-card {
    padding: 25px 15px;
    background: var(--panel);
    border: 1px solid #293529;
    border-radius: 12px;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    transition: 0.2s;
}

.category-card:hover {
    border-color: var(--green);
    transform: translateY(-4px);
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    background: var(--panel);
    color: white;
    border: 1px solid #354235;
    border-radius: 8px;
    padding: 13px 15px;
    font-family: inherit;
    font-size: 14px;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

.filters select {
    cursor: pointer;
}

.farm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.farm-card,
.guide-card {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid #293529;
    border-radius: 13px;
    transition: 0.25s;
}

.farm-card:hover,
.guide-card:hover {
    transform: translateY(-5px);
    border-color: var(--green);
}

.farm-image {
    height: 155px;
    display: grid;
    place-items: center;
    font-size: 65px;
}

.wheat { background: linear-gradient(135deg, #665020, #b38b32); }
.sugar { background: linear-gradient(135deg, #244e35, #4b9863); }
.iron { background: linear-gradient(135deg, #454b51, #89949a); }
.chicken { background: linear-gradient(135deg, #69502e, #b38b4e); }
.monster { background: linear-gradient(135deg, #332b58, #6955a0); }
.gold { background: linear-gradient(135deg, #67501c, #c79b27); }

.farm-info {
    padding: 20px;
}

.difficulty {
    font-size: 10px;
    font-weight: 800;
    padding: 6px 9px;
    border-radius: 5px;
}

.easy { color: #9dff75; background: #254b26; }
.medium { color: #ffd36a; background: #59471f; }
.hard { color: #ff8d8d; background: #572c2c; }

.farm-info h3 {
    margin: 17px 0 9px;
    font-size: 19px;
}

.farm-info p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
    min-height: 45px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #354235;
    margin-top: 18px;
    padding-top: 15px;
    color: var(--muted);
    font-size: 11px;
}

.no-results {
    display: none;
    color: var(--muted);
    text-align: center;
    padding: 35px;
}

footer {
    text-align: center;
    padding: 45px 15px;
    background: #0b100b;
    border-top: 1px solid #293529;
}

footer p {
    color: var(--muted);
    margin-top: 12px;
    font-size: 13px;
}

footer .copyright {
    font-size: 11px;
    margin-top: 25px;
}

@media (max-width: 850px) {
    .farm-grid { grid-template-columns: repeat(2, 1fr); }
    .categories { grid-template-columns: repeat(2, 1fr); }
    .hero-icon { font-size: 90px; }
}

@media (max-width: 550px) {
    .header { padding: 0 5%; }
    nav { gap: 12px; }
    nav a { font-size: 11px; }
    .hero { padding: 65px 7%; }
    .hero h1 { font-size: 36px; }
    .hero-icon { display: none; }
    .section { padding: 55px 7%; }
    .farm-grid { grid-template-columns: 1fr; }
}

.back-link {
    display: inline-block;
    color: var(--green);
    text-decoration: none;
    margin-bottom: 35px;
}

.guide-intro {
    color: var(--muted);
    line-height: 1.8;
    margin: 15px 0 25px;
}

.guide-details {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.guide-details div {
    background: var(--panel);
    border: 1px solid #354235;
    padding: 13px;
    border-radius: 8px;
    font-size: 13px;
}

.guide-image {
    min-height: 220px;
    display: grid;
    place-items: center;
    font-size: 85px;
    background: linear-gradient(135deg, #244e35, #b38b32);
    border-radius: 15px;
    margin-bottom: 40px;
}

.section h2 {
    margin: 35px 0 18px;
}

.material-list {
    list-style: none;
    background: var(--panel);
    border-radius: 12px;
    padding: 20px;
    line-height: 2.5;
    color: var(--muted);
}

.step {
    display: flex;
    gap: 18px;
    padding: 22px 0;
    border-bottom: 1px solid #354235;
}

.step-number {
    color: var(--green);
    font-size: 23px;
    font-weight: 900;
}

.step h3 {
    margin-bottom: 8px;
}

.step p {
    color: var(--muted);
    line-height: 1.7;
}

.tip-box {
    background: #1e351c;
    border: 1px solid #557c36;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
    line-height: 1.8;
}

.guide {
    max-width: 1000px;
    margin: auto;
    padding: 55px 7%;
}

.guide h1 {
    font-size: 45px;
    margin-bottom: 15px;
}

.guide h2 {
    font-size: 25px;
    margin: 40px 0 18px;
}

.tutorial-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 14px;
    margin-top: 10px;
}

.image-caption {
    color: var(--muted);
    font-size: 12px;
    margin-top: 10px;
    line-height: 1.7;
}

.materials {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.materials div {
    padding: 17px;
    background: var(--panel);
    border: 1px solid #354235;
    border-radius: 9px;
}

.farm-diagram {
    background: #192b1c;
    padding: 25px;
    border-radius: 12px;
    width: fit-content;
    margin: 20px auto;
    border: 1px solid #557c36;
}

.diagram-row {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
}

.diagram-row span {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: #526d35;
    border-radius: 5px;
    font-size: 25px;
}

.diagram-row span:nth-child(3) {
    background: #2678a9;
}

@media (max-width: 550px) {
    .guide h1 {
        font-size: 34px;
    }

    .materials {
        grid-template-columns: 1fr;
    }

    .diagram-row span {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}

/* Illustrations de la ferme de canne à sucre */

.sugar-illustration {
    background: linear-gradient(135deg, #244e35, #4b9863);
    min-height: 230px;
    display: grid;
    place-items: center;
    font-size: 85px;
    border-radius: 14px;
}

/* =========================================================
   PAGE D'ACCUEIL (index.html)
   Styles utilisés par index.html qui manquaient.
   ========================================================= */

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* En-tête : logo à gauche, menu à droite */
.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* Petit texte vert au-dessus des titres */
.eyebrow {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 18px;
}

/* Texte sous le grand titre */
.hero .container > p:not(.eyebrow) {
    color: var(--muted);
    line-height: 1.8;
    max-width: 520px;
    margin-bottom: 30px;
}

/* Section des fermes */
.farms-section {
    padding: 75px 5%;
}

.farm-image.bamboo { background: linear-gradient(135deg, #3d5c1f, #7fa83a); }
.farm-image.mob { background: linear-gradient(135deg, #332b58, #6955a0); }

/* Étiquette "Java et Bedrock" */
.farm-tag {
    display: inline-block;
    color: #9dff75;
    background: #254b26;
    font-size: 11px;
    font-weight: 800;
    padding: 6px 9px;
    border-radius: 5px;
}

.farm-info h3 a {
    color: inherit;
    text-decoration: none;
}

.farm-info h3 a:hover {
    color: var(--green);
}

/* Bas de carte : difficulté + lien */
.farm-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid #354235;
    margin-top: 18px;
    padding-top: 15px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.farm-bottom a {
    color: var(--green);
    text-decoration: none;
    font-weight: 800;
}

.farm-bottom a:hover {
    text-decoration: underline;
}

.coming {
    font-style: italic;
    font-weight: 500;
}

#noResults {
    color: var(--muted);
    text-align: center;
    padding: 35px;
}

/* Section "À propos" */
.about-section {
    padding: 70px 5%;
    background: #141c14;
    border-top: 1px solid #293529;
    text-align: center;
}

.about-section h2 {
    font-size: 30px;
    margin-bottom: 15px;
}

.about-section p {
    color: var(--muted);
    line-height: 1.8;
    max-width: 620px;
    margin: 0 auto;
}

.about-tags {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 14px;
    max-width: 900px;
    margin: 30px auto 0;
    text-align: left;
}

.about-tags div {
    background: var(--panel);
    border: 1px solid #293529;
    border-radius: 10px;
    padding: 16px;
}

.about-tags strong {
    display: block;
    color: var(--green);
    margin-bottom: 6px;
}

.about-tags span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

/* =========================================================
   MODÈLE DE TUTORIEL (canne-sucre.html et les futures fermes)
   Toutes les classes commencent par "tuto-" pour ne pas
   entrer en conflit avec les styles de l'accueil.
   ========================================================= */

.tuto {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.tuto-back {
    color: var(--green);
    text-decoration: none;
    font-weight: 700;
}

.tuto-back:hover {
    text-decoration: underline;
}

/* Bandeau de titre */
.tuto-hero {
    background: linear-gradient(135deg, #153b27, #10251c);
    border: 1px solid #34784b;
    border-radius: 18px;
    padding: 30px;
    margin-top: 25px;
}

.tuto-kicker {
    color: var(--green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
}

.tuto-hero h1 {
    font-size: 34px;
    line-height: 1.2;
    margin: 12px 0;
}

.tuto-hero > p:not(.tuto-kicker) {
    color: var(--muted);
    line-height: 1.7;
    margin-bottom: 15px;
}

.tuto-tag {
    display: inline-block;
    background: #235c39;
    color: #c4ffd0;
    padding: 8px 12px;
    border-radius: 20px;
    margin: 5px 5px 0 0;
    font-size: 13px;
    font-weight: 600;
}

/* Blocs de contenu */
.tuto-section {
    background: #17251e;
    border: 1px solid #2d4435;
    border-radius: 15px;
    padding: 25px;
    margin-top: 22px;
    line-height: 1.7;
}

.tuto-section h2 {
    color: var(--green);
    font-size: 23px;
    margin-bottom: 15px;
}

.tuto-section > p {
    color: var(--muted);
    margin-bottom: 8px;
}

.tuto-section > p strong {
    color: var(--text);
}

/* Liste de matériaux à cocher */
.tuto-materials {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 10px;
    margin: 15px 0;
}

.tuto-material {
    background: #203329;
    padding: 13px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.tuto-material input {
    accent-color: var(--green);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.tuto-qty {
    margin-left: auto;
    color: #a5e987;
    font-weight: 800;
}

.tuto-progress {
    color: var(--green) !important;
    font-weight: 700;
}

/* Étapes numérotées */
.tuto-step {
    background: #203329;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.tuto-step strong {
    font-size: 17px;
}

.tuto-step p {
    color: var(--muted);
    margin-top: 6px;
}

.tuto-number {
    display: inline-block;
    background: var(--green);
    color: #10251c;
    font-weight: 900;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 28px;
    margin-right: 8px;
}

/* Encadré d'avertissement */
.tuto-notice {
    background: #34321e;
    border-left: 4px solid #e2c65d;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    color: var(--text);
}

/* Schémas */
.tuto-diagram {
    background: #101a14;
    border: 1px solid #385440;
    border-radius: 12px;
    padding: 18px;
    overflow-x: auto;
    text-align: center;
}

.tuto-diagram pre {
    color: #b9f49c;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
    display: inline-block;
}

/* Aperçu en 3D (dessiné par script.js) */
.tuto-3d-scene {
    background: radial-gradient(ellipse at 50% 40%, #1f3a27 0%, #0d1510 75%);
    border: 1px solid #385440;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: center;
}

.tuto-3d-scene svg {
    width: 100%;
    max-width: 720px;
    height: auto;
    max-height: 380px;
}

.tuto-3d-actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 20px;
}

.tuto-3d-hauteur {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.tuto-3d-hauteur strong {
    color: var(--text);
    min-width: 62px;
}

.tuto-3d-hauteur input {
    accent-color: var(--green);
    width: 130px;
}

.tuto-3d-bouton {
    background: var(--green);
    color: #14200f;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.tuto-3d-bouton:hover {
    box-shadow: 0 6px 20px #8cff4530;
}

.tuto-section > p.tuto-3d-note {
    font-size: 13px;
    margin-top: 10px;
    text-align: center;
}

/* Schémas couche par couche (dessinés par script.js) */
.tuto-section h3 {
    font-size: 18px;
    margin: 22px 0 10px;
}

.tuto-layers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
    gap: 16px;
    margin-top: 15px;
}

.tuto-layer {
    background: #101a14;
    border: 1px solid #385440;
    border-radius: 12px;
    padding: 14px;
}

.tuto-layer h4 {
    font-size: 15px;
    margin-bottom: 4px;
}

.tuto-layer p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
}

.tuto-grid {
    display: grid;
    gap: 3px;
    overflow-x: auto;
}

@media (max-width: 600px) {
    .tuto-grid { gap: 2px; }
    .tuto-grid .tuto-cell,
    .tuto-grid .tuto-label { font-size: 9px; }
}

.tuto-cell,
.tuto-label {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}

.tuto-label {
    color: var(--muted);
    font-weight: 600;
}

.tuto-cell { color: #0d140f; }

.b-air { border: 1px dashed #2b3a2f; }
.b-sol { background: #3a2f22; }
.b-verre { background: #bfe9f2; }
.b-pierre { background: #8d928f; }
.b-boue { background: #5a4a40; color: #f2f5f0; }
.b-eau { background: #2f7fd6; color: #ffffff; }
.b-entonnoir { background: #4f5458; color: #ffffff; }
.b-coffre { background: #b07a2c; }
.b-canne { background: #7ccf5a; }
.b-bambou { background: #a6c94a; }
.b-poulet { background: #f4f1e6; }
.b-labour { background: #6b4a2b; color: #f2f5f0; }
.b-tige { background: #9bc53d; }
.b-fruit { border: 2px dashed #e98a1f; color: #e98a1f; }
.b-sable { background: #e3d394; }
.b-cactus { background: #3f8f3a; color: #ffffff; }
.b-barriere { background: #9c7444; color: #ffffff; }
.b-distributeur { background: #5f6366; color: #ffffff; }
.b-ble { background: #d9b84a; }
.b-bouton { background: #b0b4b1; }
.b-carotte { background: #e8892b; }
.b-betterave { background: #b8324a; color: #ffffff; }
.b-cobble { background: #6f726f; color: #ffffff; outline: 2px dashed var(--green); }
.b-ruche { background: #e0b04a; }
.b-fleur { background: #e05a9a; color: #ffffff; }
.b-neige { background: #f4f8fb; }
.b-citrouille { background: #e98a1f; }
.b-composteur { background: #7a5a32; color: #ffffff; }
.b-villageois { background: #8a6a52; color: #ffffff; }
.b-stalactite { background: #9a7a62; color: #ffffff; }
.b-chaudron { background: #3a3d40; color: #ffffff; }
.b-ames { background: #4a3a2e; color: #ffffff; }
.b-glace { background: #74b4f0; }
.b-basalte { background: #4c4c52; color: #ffffff; outline: 2px dashed var(--green); }
.farm-image.flower { background: linear-gradient(135deg, #3f6a2a, #e05a9a); }
.farm-image.basalt { background: linear-gradient(135deg, #2a2a2e, #74b4f0); }
.farm-image.clay { background: linear-gradient(135deg, #4a5560, #a3adb8); }
.farm-image.lava { background: linear-gradient(135deg, #5a1a08, #ff6a1a); }
.farm-image.bone { background: linear-gradient(135deg, #5a5446, #d8d2bf); }
.farm-image.snow { background: linear-gradient(135deg, #3a5068, #c9dbe8); }
.farm-image.honey { background: linear-gradient(135deg, #7a5410, #e0b04a); }
.farm-image.stone { background: linear-gradient(135deg, #3d403d, #8d928f); }
.farm-image.beet { background: linear-gradient(135deg, #5a1a26, #b8324a); }
.b-vache { background: #4a3a2e; color: #ffffff; }
.b-panneau { background: #c8a26a; }
.b-lave { background: #ff6a1a; color: #2a0f00; }
.b-herbe { background: #5fa83a; }
.b-mouton { background: #ecebe4; }
.b-rail { background: #8a7a66; color: #ffffff; }
.b-trappe { background: #a8834e; }
.farm-image.sheep { background: linear-gradient(135deg, #4a5a3a, #b8c0a8); }
.farm-image.cow { background: linear-gradient(135deg, #3b2d22, #8a6a4a); }
.farm-image.carrot { background: linear-gradient(135deg, #8a4a14, #c9a84a); }
.farm-image.wheat { background: linear-gradient(135deg, #665020, #b38b32); }
.farm-image.cactus { background: linear-gradient(135deg, #2f5e2b, #8a9a4a); }
.farm-image.pumpkin { background: linear-gradient(135deg, #7a3f12, #d9822b); }
.farm-image.pig { background: linear-gradient(135deg, #6a3a42, #f0a0a8); }
.farm-image.ice { background: linear-gradient(135deg, #24405e, #9cc3f5); }
.farm-image.wart { background: linear-gradient(135deg, #3a1210, #a8262e); }
.farm-image.tree { background: linear-gradient(135deg, #2e4a1e, #d8d4c0); }
.b-piston { background: #c9a66b; }
.b-observateur { background: #6e7377; color: #ffffff; }
.b-redstone { background: #d23b2a; color: #ffffff; }

.tuto-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-top: 15px;
    font-size: 13px;
    color: var(--muted);
}

.tuto-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tuto-legend .tuto-cell {
    width: 24px;
    font-size: 10px;
}

@media (max-width: 600px) {
    .tuto { padding: 25px 12px 40px; }
    .tuto-hero { padding: 22px; }
    .tuto-hero h1 { font-size: 26px; }
    .tuto-section { padding: 18px; }
    .tuto-diagram pre { font-size: 12px; }
}

/* Très petits téléphones (320 à 380 px) : marges réduites pour que les grands schémas tiennent */
@media (max-width: 380px) {
    .tuto { padding: 20px 8px 36px; }
    .tuto-section { padding: 14px 10px; }
    .tuto-layer { padding: 8px; }
}

/* Blocs des circuits redstone */
.b-lampe { background: #f0b45a; }
.b-capteur { background: #d9cfa8; }
.b-porte { background: #c8ccd0; }
.b-plaque { background: #9a9e9b; }
.b-levier { background: #8a6a4a; color: #ffffff; }
.b-musical { background: #6b4a30; color: #ffffff; }
.farm-image.redstone { background: linear-gradient(135deg, #3a0d0d, #d23b2a); }

/* Menu du haut sur petits téléphones : 4 liens qui doivent tenir */
@media (max-width: 420px) {
    .header { height: auto; min-height: 64px; padding: 10px 4%; }
    .header .container { flex-wrap: wrap; row-gap: 6px; }
    .logo { font-size: 22px; }
    nav { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
    nav a { font-size: 11px; }
}

/* Curseur de la vue 3D : passe à la ligne sur les écrans étroits */
.tuto-3d-hauteur {
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
    max-width: 100%;
}

.tuto-3d-hauteur input {
    max-width: 100%;
}
.b-comparateur { background: #b8b2a8; }
.b-torche { background: #ff4a2a; color: #ffffff; }
.b-four { background: #6b6b6b; color: #ffffff; }
.b-crochet { background: #a07a4a; color: #ffffff; }
.b-fil { background: #e8e8e8; }
.b-sable-ames { background: #5a4636; color: #ffffff; }
.b-magma { background: #b5401a; color: #ffffff; }
.b-cochon { background: #f0a0a8; color: #3a1a1e; }
.b-glace-simple { background: #9cc3f5; color: #10223a; }
.b-verrue { background: #8e1b22; color: #ffffff; }
.b-pousse { background: #4f8f2a; color: #ffffff; }
.b-torche-simple { background: #f2b33a; color: #2a1a00; }
.b-repeteur { background: #a9a9a3; color: #6a0d0d; }
.b-ampoule { background: #c8743f; color: #ffffff; }
.b-cible { background: #e8e0d0; color: #b0141a; }
.b-lapin { background: #b58a5e; color: #ffffff; }
.b-tortue { background: #3f8a4a; color: #ffffff; }
.b-oeuf-tortue { background: #e6e2c4; color: #2f5a2a; }
.b-beton-poudre { background: #6fa8dc; color: #10223a; }
.b-beton { background: #2f6fb5; color: #ffffff; }
.b-mousse { background: #5d7d2c; color: #ffffff; }
.b-speleo { background: #8a6a52; color: #ffffff; }
.b-nylium { background: #8f1d24; color: #ffffff; }
.b-champi { background: #c2412e; color: #ffffff; }
.b-sculk { background: #0f3a44; color: #7ff3ff; }
.b-liane { background: #3f7a2a; color: #ffffff; }
.b-baies-lum { background: #e0a32e; color: #2a1a00; }
.b-cloche { background: #e7c23a; color: #3a2a00; }

/* Très petits écrans : espace réduit entre les cases des grands schémas (jusqu'à 14 colonnes) */
@media (max-width: 380px) {
    .tuto-grid { gap: 1px; }
}

/* Statut d'un guide pas encore vérifié (à tester / à confirmer) */
.farm-status { display: inline-block; margin: 0 0 4px 4px; padding: 5px 8px; border-radius: 5px; font-size: 11px; font-weight: 800; background: rgba(255, 170, 40, 0.15); color: #ffb443; border: 1px solid rgba(255, 170, 40, 0.5); }
.farm-image.rabbit { background: linear-gradient(135deg, #5a4030, #c9a27a); }
.farm-image.turtle { background: linear-gradient(135deg, #1f4a3a, #d8cf9a); }
.farm-image.concrete { background: linear-gradient(135deg, #1f3f6a, #6fa8dc); }
.farm-image.moss { background: linear-gradient(135deg, #2c3d16, #8aa84a); }

/* =========================================================
   MENU DES LANGUES (menu déroulant, fonctionne sans JavaScript)
   ========================================================= */
.lang-menu { position: relative; }
.lang-menu summary {
    list-style: none;
    cursor: pointer;
    color: var(--muted);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    user-select: none;
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary::after { content: " ▾"; }
.lang-menu[open] summary, .lang-menu summary:hover { color: var(--green); background: #1e351c; }
.lang-menu ul {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 50;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #111a11;
    border: 1px solid #2a3a2a;
    border-radius: 8px;
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.lang-menu ul a { display: block; padding: 6px 10px; white-space: nowrap; }
@media (max-width: 380px) {
    .lang-menu ul { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
    .lang-menu ul a { padding: 6px 8px; font-size: 12px; }
}

/* =========================================================
   ARABE : lecture de droite à gauche
   Les schémas et la vue 3D restent de gauche à droite
   pour que les numéros de colonnes correspondent aux étapes.
   ========================================================= */
[dir="rtl"] .lang-menu ul { right: auto; left: 0; }
[dir="rtl"] .tuto-grid,
[dir="rtl"] .tuto-3d-scene,
[dir="rtl"] .tuto-3d-hauteur input { direction: ltr; }
[dir="rtl"] .about-tags,
[dir="rtl"] .tuto-diagram pre { text-align: right; }
[dir="rtl"] .tuto-qty { margin-left: 0; margin-right: auto; }
[dir="rtl"] .tuto-number { margin-right: 0; margin-left: 8px; }
[dir="rtl"] .tuto-notice { border-left: 0; border-right: 4px solid #e2c65d; }
[dir="rtl"] .farm-status { margin: 0 4px 4px 0; }
.farm-image.dripstone { background: linear-gradient(135deg, #3d2e22, #a88a6a); }
.farm-image.nether { background: linear-gradient(135deg, #3a0d12, #c2412e); }
.farm-image.glowberry { background: linear-gradient(135deg, #2b3a1a, #e0a32e); }
.farm-image.vines { background: linear-gradient(135deg, #1f3d16, #6aa83a); }
.b-champignon { background: #b5332a; color: #ffffff; }
.b-mycelium { background: #7a6a7e; color: #ffffff; }
.b-baies-sucrees { background: #a8213a; color: #ffffff; }
.b-algues { background: #2f6a3a; color: #ffffff; }
.farm-image.mushroom { background: linear-gradient(135deg, #3a1a14, #b5332a); }
.farm-image.sweetberry { background: linear-gradient(135deg, #2a3a1a, #a8213a); }
.farm-image.kelp { background: linear-gradient(135deg, #10304a, #2f8a5a); }

/* Petits tableaux dans les guides (ex. table de vérité) : toujours dans la largeur de l'écran */
.tuto-section table { width: 100%; max-width: 100%; border-collapse: collapse; table-layout: fixed; }
.tuto-section th, .tuto-section td { padding: 4px 6px !important; overflow-wrap: anywhere; }

/* Mots très longs dans les titres (ex. danois, allemand) : coupure propre au lieu de déborder */
.tuto-hero h1, .tuto h2, .farm-info h3 { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 380px) { .lang-menu ul a { white-space: normal; } }
.b-rail-simple { background: #8a7a62; color: #ffffff; }
.b-rail-prop { background: #c9a227; color: #2a1a00; }
.b-wagonnet { background: #6e7378; color: #ffffff; }
.b-piston-collant { background: #7fae5a; color: #1a2a10; }
.b-feuilles { background: #3b7a26; color: #ffffff; }
.b-buche { background: #6b5034; color: #ffffff; }
.farm-image.charcoal { background: linear-gradient(135deg, #1a1a1a, #6b5034); }
.farm-image.wool { background: linear-gradient(135deg, #b5332a, #2f6fb5); }
.farm-image.apple { background: linear-gradient(135deg, #2e4a1e, #d23b2a); }

/* Cartes de la section "Les guides" sur l'accueil */
.guides-section { padding-top: 0; }
.farm-image.dungeon { background: linear-gradient(135deg, #2a2f2a, #5d7a4a); }
.farm-image.mcdungeons { background: linear-gradient(135deg, #2b1f45, #8a5cc2); }
