/* ===== Alvéoles : palette du site =====
   Turquoise : 85ECE4 · 55E0D6 · 30D5C9 · 0CC9BB · 00A094
   Bleu      : 91B0EE · 6590E4 · 4275DB · 205BD0 · 0C42AC
   Vert      : 95F68B · 6AF05C · 46EB35 · 22E50E · 14D200
   Plateau comme sur le PDF : alvéoles E8F8F6 bordées de 2A9D8F, alvéoles à fleur DDF2CC.
*/
:root {
    --tq1: #85ECE4; --tq2: #55E0D6; --tq3: #30D5C9; --tq4: #0CC9BB; --tq5: #00A094;
    --bl1: #91B0EE; --bl2: #6590E4; --bl3: #4275DB; --bl4: #205BD0; --bl5: #0C42AC;
    --vt1: #95F68B; --vt2: #6AF05C; --vt3: #46EB35; --vt4: #22E50E; --vt5: #14D200;
    --noir: #2C2C2A; --dore: #FAC750; --doreFonce: #854F0B;
    --alveole: #E8F8F6; --bordAlveole: #2A9D8F; --alveoleFleur: #DDF2CC;
    /* couleurs du pied de page (legal.css) */
    --colorBackLogo: rgb(149, 246, 139);
    --colorTextP: rgb(12, 66, 172);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", Arial, sans-serif;
}
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bl1);
}

.jeuAL {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 20px 70px;   /* place en bas pour le lien « Accueil » des petits écrans */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.titreAL {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    letter-spacing: 2px;
    text-align: center;
    color: var(--bl5);
    text-shadow: 0 2px 0 var(--tq1);
}

/* ----- Écran de réglages ----- */
.carteAL {
    width: 100%;
    max-width: 640px;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    color: var(--bl5);
    background-image:
        linear-gradient(160deg, var(--tq1), var(--tq2)),
        linear-gradient(135deg, var(--bl4), var(--vt3));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 4px solid transparent;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(12, 66, 172, 0.35);
}
.consigneAL { font-size: 1.15rem; }
.reglageAL { width: 100%; border: none; }
.reglageAL legend {
    width: 100%;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}
.puces { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.puceAL { position: relative; cursor: pointer; }
.puceAL input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.puceAL > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.7);
    border: 3px solid var(--bl3);
    border-radius: 24px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.puceAL small { font-size: 0.8rem; font-weight: 400; }
.puceAL .pastilleAL { margin: 0 0 4px; }
.puceAL input:checked + span {
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border-color: var(--bl5);
}
.puceAL input:focus-visible + span { outline: 4px solid var(--vt4); outline-offset: 2px; }

.pastilleAL {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: -3px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--noir);
}
.pastilleAL.noire { background-color: var(--noir); }
.pastilleAL.doree { background-color: var(--dore); }

/* ----- Boutons ----- */
.boutonsAL { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.boutonAL {
    display: inline-flex;
    align-items: center;
    padding: 12px 34px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border: none;
    border-radius: 34px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--bl5);
    transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
}
.boutonAL.petit { padding: 9px 18px; font-size: 1rem; letter-spacing: 0; }
.boutonAL:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--vt5), var(--vt3));
    color: var(--bl5);
    box-shadow: 0 5px 0 var(--tq5);
}
.boutonAL:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--tq5); }
.boutonAL:disabled { opacity: 0.45; cursor: default; }
.boutonAL.secondaire { background: linear-gradient(135deg, var(--tq5), var(--tq4)); }
.boutonAL[aria-pressed="true"] {
    color: var(--noir);
    background: linear-gradient(135deg, var(--dore), #FDE3A0);
    box-shadow: 0 5px 0 var(--doreFonce);
}
.boutonAL:focus-visible, .lienAL:focus-visible, .lienPdfAL:focus-visible {
    outline: 4px solid var(--vt4);
    outline-offset: 3px;
}
.lienAL, .lienPdfAL {
    font-size: 1rem;
    font-weight: 700;
    color: var(--bl5);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

/* Encadré des règles */
.reglesAL {
    width: 100%;
    max-width: 640px;
    padding: 12px 20px;
    text-align: left;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.75);
    border: 3px solid var(--tq3);
    border-radius: 20px;
}
.reglesAL h2 { font-size: 1.1rem; margin-bottom: 6px; }
.reglesAL ol, .reglesAL ul { padding-left: 1.3em; }
.reglesAL li { margin: 5px 0; line-height: 1.45; }
.reglesAL p { margin-top: 6px; line-height: 1.45; }

/* ----- Écran de jeu ----- */
#ecranJeu { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bandeauAL {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 16px;
    padding: 8px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.6);
    border: 3px solid var(--tq3);
    border-radius: 26px;
}
.tourAL, .scoreAL { display: flex; align-items: center; }
.scoresAL { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.scoreAL small { margin-left: 4px; font-weight: 400; font-size: 0.85rem; }
.messageAL {
    min-height: 1.5em;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    color: var(--bl5);
}
.partageAL {
    width: 100%;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    color: var(--bl5);
    background-color: #fff;
    border: 3px solid var(--dore);
    border-radius: 20px;
}
.partageAL p { margin-bottom: 10px; }

/* Plateau */
.plateauAL {
    position: relative;
    width: 100%;
    padding: 8px;
    background-color: #fff;
    border: 4px solid var(--bordAlveole);
    border-radius: 22px;
    box-shadow: 0 6px 16px rgba(12, 66, 172, 0.25);
}
.plateauAL svg { display: block; width: 100%; height: auto; max-height: 78vh; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.case .fond { fill: var(--alveole); stroke: var(--bordAlveole); stroke-width: 0.9; transition: fill 0.15s; }
.case.fleur .fond { fill: var(--alveoleFleur); }
.case.interdite .fond { fill: #D3D6D6; }
.case.jouable { cursor: pointer; }
@media (hover: hover) {
    .case.jouable:hover .fond { fill: #FFF3C4; }
    .modeReine .case.jouable:hover .fond { fill: #FDE3A0; }
}
.case.dernier .fond { stroke: var(--bl4); stroke-width: 1.8; }
.case .secours { stroke: #fff; stroke-width: 0.6; }
.case .secours.noire { fill: var(--noir); }
.case .secours.doree { fill: var(--dore); }
.case.fanee image { opacity: 0.35; filter: grayscale(1); }
/* Fleur récoltée (niveau 3) : anneau de la couleur de la ruche */
.case .recolte { fill: none; stroke-width: 1.6; }
.case .recolte.noire { stroke: var(--noir); }
.case .recolte.doree { stroke: #D9A21B; }
/* Jardins (en fin de partie) */
.case .jardin { stroke: #fff; stroke-width: 0.5; }
.case .jardin.noire { fill: var(--noir); }
.case .jardin.doree { fill: var(--dore); }
.case.apparait .pion { animation: apparait 0.5s ease-out; }

/* Abeilles retournées : elles tournent sur elles-mêmes */
.pion { transform-box: fill-box; transform-origin: center; }
.pion.tourne { animation: tourne 0.4s ease-in-out; }
@keyframes tourne {
    0%   { transform: scaleX(1); }
    50%  { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}
@keyframes apparait {
    from { opacity: 0; transform: scale(0.3); }
    to   { opacity: 1; transform: scale(1); }
}

/* Le dé du pré surprise */
.deAL {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 14px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.75);
    border-radius: 18px;
}
.faceDe {
    width: 96px;
    height: 96px;
    padding: 12px;
    display: grid;
    grid-template: repeat(3, 1fr) / repeat(3, 1fr);
    place-items: center;
    background-color: #fff;
    border: 4px solid var(--bl5);
    border-radius: 18px;
    box-shadow: 0 6px 0 var(--bl5);
}
.faceDe span { width: 16px; height: 16px; border-radius: 50%; }
.faceDe span.point { background-color: var(--bl5); }
.faceDe.roule { animation: secoue 0.18s linear infinite; }
@keyframes secoue {
    0% { transform: rotate(-12deg); }
    50% { transform: rotate(12deg); }
    100% { transform: rotate(-12deg); }
}

/* Fin de partie */
.finAL {
    width: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    color: var(--bl5);
    background-color: #fff;
    border: 4px solid var(--vt4);
    border-radius: 22px;
}
.gagnantAL { font-size: 1.5rem; font-weight: 900; }
.raisonFin { font-size: 0.95rem; }
.recapAL { border-collapse: collapse; font-size: 1.05rem; }
.recapAL th, .recapAL td { padding: 6px 14px; border-bottom: 2px solid var(--tq1); }
.recapAL th:first-child, .recapAL td:first-child { text-align: left; }
.recapAL tr.total td { font-weight: 900; border-bottom: none; }
.recapAL td.gagne { color: var(--tq5); }

/* ----- Téléphone : le plateau prend toute la largeur ----- */
@media (max-width: 560px) {
    .jeuAL { padding: 14px 6px 70px; gap: 12px; }
    .carteAL { padding: 18px 12px; }
    .plateauAL { padding: 2px; border-width: 3px; border-radius: 14px; }
    .bandeauAL { padding: 6px 12px; font-size: 0.95rem; }
    .boutonAL { padding: 10px 24px; font-size: 1.15rem; }
    .boutonAL.petit { padding: 8px 14px; font-size: 0.95rem; }
    .recapAL th, .recapAL td { padding: 5px 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .pion.tourne, .case.apparait .pion, .faceDe.roule { animation: none; }
    .boutonAL, .case .fond { transition: none; }
}
