body.page-jeu-plantalys-wp {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* =====================================================
   VARIABLES ET RESET
===================================================== */

* {
    box-sizing: border-box;
}

:root {
    --vert: #82ad16;
    --vert-fonce: #587c0d;
    --brun: #754719;
    --brun-fonce: #4a260f;
    --or: #d4a543;
    --fond: #f5f1e4;
    --texte: #543a25;
    --blanc: #ffffff;
    --rouge: #9c382d;
    --bordure: #b9cbc0;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    padding: 0;
}

body {
    overflow-x: hidden;
    color: var(--texte);
    font-family: Arial, Helvetica, sans-serif;
    background-color: var(--fond);
}

/* =====================================================
   MASQUAGE DU THÈME WORDPRESS
===================================================== */

/*
 * Nous ne masquons pas tous les éléments header.
 * Le header du jeu porte la classe .entete et doit rester visible.
 */

/* Bandeau et navigation classiques du thème */
body.page-jeu-plantalys-wp > header,
body.page-jeu-plantalys-wp > footer,
body.page-jeu-plantalys-wp > nav,

body.page-jeu-plantalys-wp .site-header,
body.page-jeu-plantalys-wp .site-footer,
body.page-jeu-plantalys-wp .main-header,
body.page-jeu-plantalys-wp .theme-header,
body.page-jeu-plantalys-wp .header-wrapper,
body.page-jeu-plantalys-wp .top-header,
body.page-jeu-plantalys-wp .main-navigation,
body.page-jeu-plantalys-wp .primary-navigation,
body.page-jeu-plantalys-wp .breadcrumb,
body.page-jeu-plantalys-wp .breadcrumbs {
    display: none !important;
}

/*
 * Le conteneur du jeu reste visible.
 * Les conteneurs WordPress autour de la page
 * ne doivent pas imposer de largeur ou de marge.
 */
body.page-jeu-plantalys-wp .site,
body.page-jeu-plantalys-wp .site-content,
body.page-jeu-plantalys-wp .site-main,
body.page-jeu-plantalys-wp .content-area,
body.page-jeu-plantalys-wp .entry-content,
body.page-jeu-plantalys-wp .wp-site-blocks,
body.page-jeu-plantalys-wp .wp-block-post-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/*
 * Ne pas cibler tous les éléments main sans distinction :
 * #defi-plantalys contient lui-même un main.
 */
body.page-jeu-plantalys-wp main,
body.page-jeu-plantalys-wp .site-main,
body.page-jeu-plantalys-wp .entry-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* =====================================================
   CONTENEUR PRINCIPAL DU JEU
===================================================== */

#defi-plantalys {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: auto !important;

    background-image: url("https://plantalys.fr/wp-content/uploads/2026/09/fond-jeu.png");
    background-repeat: no-repeat;
    background-position: center top;
    background-size: cover;
}

/* =====================================================
   APPLICATION ET ÉCRANS
===================================================== */

#defi-plantalys .application {
    position: relative;
    z-index: 1;

    width: min(1320px, 100%);
    min-height: 100vh;
    margin: 0 auto;
    padding: 16px 24px 45px;
}

#defi-plantalys .ecran {
    display: none;
}

#defi-plantalys .ecran.actif {
    display: block;
}

/* =====================================================
   EN-TÊTE INTERNE DU JEU
===================================================== */

#defi-plantalys .entete {
    display: flex;
    align-items: flex-start;
    gap: 28px;
    height: 75px;
    margin: 0 0 12px;
}

#defi-plantalys .logo {
    display: block;
    width: 180px;
    color: var(--brun);
    font-size: 31px;
    font-weight: bold;
    line-height: 0.92;
}

#defi-plantalys .logo img {
    display: block;
    width: 180px;
    max-width: 100%;
    height: auto;
}

#defi-plantalys h1 {
    display: block;
    margin: 0;
    color: var(--brun);
    font-family: Georgia, serif;
    font-size: 62px;
}

#defi-plantalys h2 {
    margin-top: 0;
}

#defi-plantalys h3 {
    margin: 0 0 6px;
    color: var(--brun);
    font-size: 17px;
}

#defi-plantalys .surtitre {
    margin: 0 0 5px;
    color: var(--brun);
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* =====================================================
   ACCUEIL
===================================================== */

#defi-plantalys #accueil {
    position: relative;
    z-index: 1;
}

#defi-plantalys #accueil .bloc-introduction,
#defi-plantalys #accueil .etapes,
#defi-plantalys #accueil .message {
    position: relative;
    z-index: 2;
}

#defi-plantalys .accueil-layout {
    display: grid;
    grid-template-columns:
        minmax(230px, 270px)
        minmax(500px, 660px)
        minmax(250px, 300px);

    justify-content: center;
    align-items: center;
    gap: 28px;

    width: 100%;
    min-height: 700px;
}

#defi-plantalys .bloc-introduction {
    position: relative;
    z-index: 3;
    width: 100%;
    align-self: center;
}

#defi-plantalys .bloc-introduction h2 {
    margin-bottom: 8px;
    color: var(--vert);
    font-size: 25px;
    line-height: 1.08;
}

#defi-plantalys .bloc-introduction > p {
    margin: 0;
    font-size: 17px;
    line-height: 1.4;
}

#defi-plantalys .cadeaux {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 42px;
    color: var(--vert);
    font-weight: bold;
}

#defi-plantalys .cadeaux p {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
}

#defi-plantalys .icone-cadeau {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    flex: 0 0 55px;
    border-radius: 50%;
    background: var(--vert);
    font-size: 27px;
}

/* =====================================================
   ROUE
===================================================== */

#defi-plantalys .bloc-roue {
    width: 100%;
    min-width: 0;
    text-align: center;
}

#defi-plantalys .bloc-roue .zone-roue {
    width: min(100%, 660px);
    margin: 0 auto;
}

#defi-plantalys .bloc-roue .bouton-principal {
    margin-top: 18px;
}

#defi-plantalys .zone-roue {
    position: relative;
    width: min(660px, 56vw);
    margin: 0 auto;
}

#defi-plantalys .cadre-roue {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    padding: 18px;
    border: 15px solid var(--brun-fonce);
    border-radius: 50%;
    background: var(--or);
    box-shadow:
        0 12px 18px rgba(0, 0, 0, 0.35),
        inset 0 0 0 5px #f2ce6d,
        inset 0 0 0 11px #773d13;
}

#defi-plantalys #roue {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
}

#defi-plantalys .pointeur {
    position: absolute;
    z-index: 10;
    top: -21px;
    left: 50%;
    width: 0;
    height: 0;
    transform: translateX(-50%);
    border-right: 29px solid transparent;
    border-left: 29px solid transparent;
    border-top: 68px solid #b9d52a;
    filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.4));
}

/* =====================================================
   LEDS
===================================================== */

#defi-plantalys .couronne-leds {
    position: absolute;
    z-index: 8;
    inset: 7px;
    pointer-events: none;
    border-radius: 50%;
}

#defi-plantalys .led {
    position: absolute;
    width: 9px;
    height: 9px;
    margin: 0;
    border-radius: 50%;
    background: #fff2a5;
    box-shadow:
        0 0 4px #fff6bd,
        0 0 9px #ffd65c;
}

#defi-plantalys .led:nth-child(1) {
    --position: 0;
}

#defi-plantalys .led:nth-child(2) {
    --position: 1;
}

#defi-plantalys .led:nth-child(3) {
    --position: 2;
}

#defi-plantalys .led:nth-child(4) {
    --position: 3;
}

#defi-plantalys .led:nth-child(5) {
    --position: 4;
}

#defi-plantalys .led:nth-child(6) {
    --position: 5;
}

#defi-plantalys .led:nth-child(7) {
    --position: 6;
}

#defi-plantalys .led:nth-child(8) {
    --position: 7;
}

#defi-plantalys .led:nth-child(9) {
    --position: 8;
}

#defi-plantalys .led:nth-child(10) {
    --position: 9;
}

#defi-plantalys .led:nth-child(11) {
    --position: 10;
}

#defi-plantalys .led:nth-child(12) {
    --position: 11;
}

#defi-plantalys .led:nth-child(13) {
    --position: 12;
}

#defi-plantalys .led:nth-child(14) {
    --position: 13;
}

#defi-plantalys .led:nth-child(15) {
    --position: 14;
}

#defi-plantalys .led:nth-child(16) {
    --position: 15;
}

#defi-plantalys .led:nth-child(17) {
    --position: 16;
}

#defi-plantalys .led:nth-child(18) {
    --position: 17;
}

#defi-plantalys .led:nth-child(19) {
    --position: 18;
}

#defi-plantalys .led:nth-child(20) {
    --position: 19;
}

#defi-plantalys .led:nth-child(21) {
    --position: 20;
}

#defi-plantalys .led:nth-child(22) {
    --position: 21;
}

#defi-plantalys .led:nth-child(23) {
    --position: 22;
}

#defi-plantalys .led:nth-child(24) {
    --position: 23;
}

@keyframes defi-scintillement-led {
    0%,
    100% {
        opacity: 0.65;
        box-shadow:
            0 0 4px #fff6bd,
            0 0 8px #ffd65c;
    }

    50% {
        opacity: 1;
        box-shadow:
            0 0 7px #fffbd1,
            0 0 16px #ffe16a;
    }
}

#defi-plantalys .led:nth-child(3n) {
    animation: defi-scintillement-led 1.2s infinite;
}

#defi-plantalys .led:nth-child(5n) {
    animation-delay: 0.35s;
}

/* =====================================================
   ÉTAPES
===================================================== */

#defi-plantalys .etapes {
    display: grid;
    gap: 27px;
}

#defi-plantalys .etape {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
}

#defi-plantalys .etape > span {
    display: grid;
    place-items: center;
    width: 55px;
    height: 55px;
    flex: 0 0 55px;
    border-radius: 50%;
    background: var(--vert);
    color: white;
    font-size: 22px;
    font-weight: bold;
}

#defi-plantalys .etape:nth-child(even) > span {
    background: var(--brun);
}

#defi-plantalys .etape p {
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

/* =====================================================
   BOUTONS
===================================================== */

#defi-plantalys button {
    position: relative;
    z-index: 20;
    pointer-events: auto;
    cursor: pointer;
    font-family: inherit;
}

#defi-plantalys button:disabled {
    pointer-events: none;
    cursor: not-allowed;
}

#defi-plantalys .bouton-principal,
#defi-plantalys .bouton-secondaire,
#defi-plantalys .bouton-danger {
    display: block;
    margin: 15px auto;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 14px;
    
font-weight: 700;
    border: 0;
    color: #fff;
    background: var(--brun);
    box-shadow: 0 4px 10px rgba(0,0,0,.22);
}

#defi-plantalys .bouton-principal:hover,
#defi-plantalys .bouton-secondaire:hover {
    background: var(--brun-fonce);
}

#defi-plantalys .bouton-danger {
    color: #fff;
    border: 0;
    background: var(--rouge);
}

#defi-plantalys .bouton-principal:disabled,
#defi-plantalys .bouton-secondaire:disabled,
#defi-plantalys .bouton-danger:disabled {
    opacity: .5;
}

/* =====================================================
   QUIZ / FORMULAIRE / ADMINISTRATION
===================================================== */

#defi-plantalys .barre-quiz {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 12px auto 14px;
    max-width: 850px;
}

#defi-plantalys .barre-quiz h2,
#defi-plantalys .bloc-question h2,
#defi-plantalys .bloc-resultat h2,
#defi-plantalys .formulaire h2 {
    margin: 0;
    color: var(--brun);
}

#defi-plantalys .score-actuel { white-space: nowrap; font-size: 18px; }
#defi-plantalys .progression {
    max-width: 850px;
    height: 9px;
    margin: 0 auto 24px;
    overflow: hidden;
    border-radius: 9px;
    background: rgba(255,255,255,.45);
}
#defi-plantalys #barre-progression { height:100%; width:0; background:var(--brun); transition:width .25s ease; }
#defi-plantalys .bloc-question,
#defi-plantalys .bloc-resultat,
#defi-plantalys .formulaire,
#defi-plantalys .panneau-administration {
    width: min(850px, 100%);
    margin: 0 auto;
    padding: clamp(20px, 4vw, 36px);
    border-radius: 18px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 8px 30px rgba(70,50,20,.12);
}
#defi-plantalys .bloc-question h2 { font-size: clamp(23px,4vw,34px); line-height:1.18; }
#defi-plantalys .reponses { display:grid; gap:12px; margin-top:24px; }
#defi-plantalys .reponse,
#defi-plantalys .reponse-image {
    width:100%; padding:15px; border:2px solid #c8d4a4; border-radius:12px;
    background:#fff; color:var(--texte); text-align:left; cursor:pointer;
}
#defi-plantalys .reponse:hover,
#defi-plantalys .reponse-image:hover { border-color:var(--brun); }
#defi-plantalys .reponse.correcte { background:#dfeec9; border-color:#4e8a2f; }
#defi-plantalys .reponse.fausse { background:#f3d9d3; border-color:var(--rouge); }
#defi-plantalys .correction { min-height:25px; margin:15px 0; font-weight:700; }
#defi-plantalys .bloc-resultat { text-align:center; margin-top:30px; }
#defi-plantalys .score-final { margin:15px 0; color:var(--brun); font-size:clamp(58px,12vw,100px); font-weight:700; }
#defi-plantalys .lot { font-size:18px; }
#defi-plantalys #bouton-retour-accueil { display:block; margin:16px auto; }
#defi-plantalys .formulaire { margin-top:20px; }
#defi-plantalys .formulaire label:not(.case-consentement) { display:block; margin-top:15px; font-weight:700; }
#defi-plantalys .formulaire input[type="text"],
#defi-plantalys .formulaire input[type="email"],
#defi-plantalys .formulaire input[type="tel"] {
    display:block; width:100%; min-height:46px; margin-top:6px; padding:10px 12px;
    border:1px solid var(--bordure); border-radius:9px; background:#fff;
}
#defi-plantalys .consentements { margin:22px 0 8px; padding:15px; border:1px solid #c8d4a4; border-radius:12px; }
#defi-plantalys .case-consentement { display:flex; gap:10px; align-items:flex-start; margin:10px 0; font-weight:400 !important; }
#defi-plantalys .case-consentement input { margin-top:3px; flex:0 0 auto; }
#defi-plantalys .note-consentement { font-size:13px; }
#defi-plantalys .formulaire .bouton-principal,
#defi-plantalys .formulaire .bouton-secondaire { width:100%; margin-top:12px; }
#defi-plantalys .lien-administration { display:block; width:max-content; margin:28px auto 0; color:var(--brun); font-size:12px; text-decoration:none; opacity:.65; }
#defi-plantalys .panneau-administration { margin-top:20px; }
#defi-plantalys .administration-entete { display:flex; justify-content:space-between; align-items:center; gap:15px; }
#defi-plantalys .administration-entete h2 { margin:0; color:var(--brun); }
#defi-plantalys .bouton-fermer { border:0; background:none; color:var(--brun); cursor:pointer; }
#defi-plantalys .tableau-scroll { overflow-x:auto; margin:18px 0; }
#defi-plantalys #tableau-participations { width:100%; border-collapse:collapse; font-size:13px; background:#fff; }
#defi-plantalys #tableau-participations th,
#defi-plantalys #tableau-participations td { padding:7px; border:1px solid #ddd; white-space:nowrap; }
#defi-plantalys #tableau-participations th { background:#eee8d5; text-align:left; }

/* =====================================================
   CENTRE DE LA ROUE
===================================================== */

#defi-plantalys .roue-centre {
    position: absolute;
    z-index: 9;
    top: 50%;
    left: 50%;
    /* Le cercle central du canvas fait 116 px sur une roue de 600 px.
       14 % de la largeur de la roue laisse une marge nette autour du logo. */
    width: 14%;
    height: auto;
    max-width: 84px;
    object-fit: contain;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* =====================================================
   MODE ADMINISTRATION
===================================================== */

body.defi-mode-admin #defi-plantalys .ecran,
body.defi-mode-admin #defi-plantalys .lien-administration {
    display: none !important;
}

body.defi-mode-admin #defi-plantalys .panneau-administration {
    display: block !important;
    margin: 30px auto;
    max-width: 1100px;
}

/* =====================================================
   PROTECTION PAR MOT DE PASSE
===================================================== */

#defi-password-gate {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: url("https://plantalys.fr/wp-content/uploads/2026/09/fond-jeu.png") center top / cover no-repeat;
}

.defi-password-box {
    width: min(440px, 100%);
    padding: 32px;
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 35px rgba(0,0,0,.25);
    text-align: center;
}

.defi-password-box h1 {
    margin: 0 0 10px;
    color: var(--brun);
    font-family: Georgia, serif;
}

.defi-password-box p {
    margin: 0 0 20px;
}

.defi-password-box form p {
    margin: 0;
}

.defi-password-box input[type="password"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--bordure);
    border-radius: 9px;
}

.defi-password-box input[type="submit"] {
    width: 100%;
    margin-top: 12px;
    padding: 13px 20px;
    border: 0;
    border-radius: 28px;
    color: #fff;
    background: var(--brun);
    font-weight: 700;
}

/* =====================================================
   SMARTPHONE
===================================================== */
@media (max-width: 1100px) {
    #defi-plantalys .application { padding:12px 14px 24px; }
    #defi-plantalys .entete { min-height:70px; height:auto; gap:6px; margin-bottom:2px; flex-direction:column; align-items:center; }
    #defi-plantalys .logo { order:2; width:112px; }
    #defi-plantalys .logo img { width:112px; }
    #defi-plantalys .entete h1 { order:1; font-size:36px; }
    #defi-plantalys .accueil-layout { display:flex; flex-direction:column; min-height:auto; gap:12px; padding-top:6px; }
    #defi-plantalys .bloc-introduction { order:1; width:100%; max-width:520px; text-align:center; }
    #defi-plantalys .bloc-introduction h2 { font-size:21px; }
    #defi-plantalys .bloc-introduction > p { font-size:15px; }
    #defi-plantalys .cadeaux { display:none; }
    #defi-plantalys .bloc-roue { order:2; width:100%; }
    #defi-plantalys .zone-roue { width:min(92vw,460px); }
    #defi-plantalys .bloc-roue .bouton-principal { width:min(92vw,390px); }
    #defi-plantalys .etapes { order:3; display:none; }
    #defi-plantalys .lien-administration { margin-top:18px; }
    #defi-plantalys .barre-quiz { align-items:center; margin-top:10px; }
    #defi-plantalys .barre-quiz h2 { font-size:20px; }
    #defi-plantalys .score-actuel { font-size:15px; }
    #defi-plantalys .bloc-question,
    #defi-plantalys .bloc-resultat,
    #defi-plantalys .formulaire,
    #defi-plantalys .panneau-administration { border-radius:14px; padding:18px; }
}

@media (min-width: 801px) and (max-width: 1100px) {
    #defi-plantalys .application { padding:14px 20px 35px; }
    #defi-plantalys .entete { min-height:70px; height:auto; margin-bottom:4px; }
    #defi-plantalys .entete h1 { font-size:46px; }
    #defi-plantalys .logo,
    #defi-plantalys .logo img { width:150px; }
    #defi-plantalys .accueil-layout {
        grid-template-columns: minmax(220px, 300px) minmax(430px, 560px);
        gap:20px;
        min-height:0;
        align-items:center;
    }
    #defi-plantalys .etapes,
    #defi-plantalys .cadeaux { display:none; }
    #defi-plantalys .bloc-roue { width:100%; }
    #defi-plantalys .zone-roue { width:min(68vw, 560px); max-width:560px; }
    #defi-plantalys .roue-centre { width:clamp(58px, 10vw, 76px); height:clamp(58px, 10vw, 76px); }
}

@media (max-width:420px) {
    #defi-plantalys .entete h1 { font-size:31px; }
    #defi-plantalys .zone-roue { width:94vw; }
    #defi-plantalys .pointeur { top:-21px; border-left-width:18px; border-right-width:18px; border-top-width:42px; }
    #defi-plantalys .barre-quiz { gap:10px; }
    #defi-plantalys .barre-quiz h2 { font-size:18px; }
    #defi-plantalys .score-actuel { font-size:14px; }
}
