/* ===== Le pont solide : palette du site =====
   Turquoise : 85ECE4 · 55E0D6 · 30D5C9 · 0CC9BB · 00A094
   Bleu      : 91B0EE · 6590E4 · 4275DB · 205BD0 · 0C42AC
   Vert      : 95F68B · 6AF05C · 46EB35 · 22E50E · 14D200
*/
: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;
    --rouge1: #F58A6B; --rouge2: #D9553A; --rouge3: #A83A25;
    /* couleurs utilisées par le 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); }
.jeuPS {
    width: 100%; max-width: 920px; margin: 0 auto; padding: 20px 20px 30px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.titrePS {
    font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 900; letter-spacing: 2px; text-align: center;
    color: var(--bl5); text-shadow: 0 2px 0 var(--tq1);
}

/* ----- Carte de choix du niveau ----- */
.cartePS {
    width: 100%; max-width: 640px; padding: 26px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
    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);
}
#ecranChoix { margin: 0 auto; }
.consignePS { font-size: 1.2rem; color: var(--bl5); }
.noteExpertPS { font-size: 1rem; font-weight: 700; color: var(--bl5); opacity: 0.75; }
.niveauxPS { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.niveauPS {
    display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px;
    padding: 10px 14px; font-size: 1.05rem; font-weight: 700; text-align: left; color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.75); border: 3px solid var(--bl3); border-radius: 30px; cursor: pointer;
    transition: background-color 0.2s, transform 0.15s;
}
.niveauPS:hover { background-color: #fff; transform: translateY(-2px); }
.niveauPS:focus-visible, .lienPS:focus-visible, .boutonPS:focus-visible { outline: 4px solid var(--vt4); outline-offset: 3px; }
.numPS {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 900; color: #fff; background: linear-gradient(135deg, var(--bl4), var(--bl3)); border-radius: 50%;
}
.etoilesPS { font-size: 1.1rem; letter-spacing: 1px; color: var(--vt5); }

/* ----- Boutons ----- */
.boutonPS {
    display: inline-block; padding: 12px 30px; font-size: 1.2rem; font-weight: 900; letter-spacing: 1px; text-align: center;
    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;
}
.boutonPS:hover:not(:disabled) { background: linear-gradient(135deg, var(--vt5), var(--vt3)); color: var(--bl5); box-shadow: 0 5px 0 var(--tq5); }
.boutonPS:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--tq5); }
.boutonPS:disabled { opacity: 0.55; cursor: default; }
.boutonPS.secondaire { background: linear-gradient(135deg, var(--tq5), var(--tq4)); font-size: 1.05rem; padding: 12px 22px; }
.lienPS { font-size: 1rem; font-weight: 700; color: var(--bl5); background: none; border: none; text-decoration: underline; cursor: pointer; }

/* ----- Écran de jeu ----- */
#ecranJeu { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.infosPS {
    width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px;
    padding: 8px 20px; font-size: 1.1rem; font-weight: 700; color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.55); border: 3px solid var(--tq3); border-radius: 30px;
}
.consigneJeuPS { font-size: 1.25rem; font-weight: 700; text-align: center; color: var(--bl5); }
.plateauPS {
    width: 100%; line-height: 0; border: 5px solid var(--bl4); border-radius: 20px; overflow: hidden;
    box-shadow: 0 10px 30px rgba(12, 66, 172, 0.4); transition: box-shadow 0.6s, border-color 0.6s;
}
.plateauPS.complet { border-color: var(--vt4); box-shadow: 0 0 0 6px rgba(70, 235, 53, 0.45), 0 10px 30px rgba(12, 66, 172, 0.4); }
#canvasPont { display: block; width: 100%; height: auto; aspect-ratio: 900 / 500; touch-action: manipulation; }

/* ----- Panneau de message et de boutons ----- */
.panneauPS { width: 100%; max-width: 680px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#messagePS {
    width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: center;
    padding: 10px 18px; font-size: 1.25rem; font-weight: 700; line-height: 1.3; text-align: center; color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.55); border: 3px dashed var(--tq5); border-radius: 24px;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
#messagePS.ok { background-color: var(--vt1); border: 3px solid var(--vt5); }
#messagePS.ko { color: #fff; background-color: var(--rouge2); border: 3px solid var(--rouge3); }
.boutonsPS { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.comprendrePS {
    width: 100%; padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; text-align: center;
    font-size: 1.1rem; color: var(--bl5); background-color: rgba(255, 255, 255, 0.7); border: 3px solid var(--tq3); border-radius: 20px;
}
.chiffresPS { font-weight: 900; }
.legendePS { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 1rem; }
.legendePS li { display: flex; align-items: center; gap: 8px; }
.pastillePS { width: 28px; height: 12px; border-radius: 6px; border: 1px solid rgba(12, 66, 172, 0.5); }
.vertPS { background: hsl(120, 85%, 46%); }
.jaunePS { background: hsl(60, 85%, 46%); }
.rougePS { background: hsl(0, 85%, 46%); }

@media (max-width: 520px) {
    .jeuPS { padding: 12px 10px 30px; }
    .cartePS { padding: 20px 14px; }
    .boutonPS { padding: 10px 18px; font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) { .niveauPS, .boutonPS, .plateauPS { transition: none; } }
