/* ===== L'orgue à verres d'eau : 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 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);
}

.jeuOV {
    width: 100%;
    max-width: 900px;
    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;
}
.titreOV {
    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);
}

/* ----- Carte de choix ----- */
.carteOV {
    width: 100%;
    max-width: 620px;
    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);
}
.consigneOV { font-size: 1.2rem; color: var(--bl5); }
.aideMode { min-height: 2.8em; font-size: 1.05rem; color: var(--bl5); }
.reglageOV { width: 100%; border: none; }
.reglageOV legend {
    width: 100%;
    margin-bottom: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: var(--bl5);
}
.puces { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.puceOV { position: relative; cursor: pointer; }
.puceOV input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.puceOV span {
    display: block;
    padding: 9px 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: 30px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.puceOV input:checked + span {
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border-color: var(--bl5);
}
.puceOV input:focus-visible + span { outline: 4px solid var(--vt4); outline-offset: 2px; }
.optionOV {
    display: inline-block;
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bl5);
    cursor: pointer;
}
.optionOV input { width: 20px; height: 20px; vertical-align: middle; margin-right: 6px; accent-color: var(--bl4); }

/* ----- Boutons ----- */
.boutonOV {
    display: inline-block;
    padding: 12px 34px;
    font-size: 1.3rem;
    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;
}
.boutonOV.petit { padding: 9px 20px; font-size: 1.05rem; letter-spacing: 0; }
.boutonOV:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--vt5), var(--vt3));
    color: var(--bl5);
    box-shadow: 0 5px 0 var(--tq5);
}
.boutonOV:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--tq5); }
.boutonOV:disabled { opacity: 0.45; cursor: default; }
.boutonOV.secondaire { background: linear-gradient(135deg, var(--tq5), var(--tq4)); box-shadow: 0 5px 0 var(--bl5); }
.boutonOV.enCours { background: linear-gradient(135deg, var(--rouge2), var(--rouge1)); box-shadow: 0 5px 0 var(--rouge3); }
.boutonOV:focus-visible, .lienOV:focus-visible, .verre:focus-visible, .niveaux button:focus-visible {
    outline: 4px solid var(--vt4);
    outline-offset: 3px;
}
.lienOV {
    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: 14px; }
.infosOV {
    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;
}
.pisteOV {
    width: 100%;
    max-width: 700px;
    padding: 6px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #fff;
    border: 4px solid var(--bl4);
    border-radius: 18px;
    box-shadow: 0 6px 16px rgba(12, 66, 172, 0.25);
}
.pisteOV svg { display: block; max-width: 100%; height: auto; }
.pisteOV .lignes, .pisteOV .trait { stroke: var(--bl5); stroke-width: 0.07; fill: none; }
.pisteOV .trait { stroke-width: 0.1; }
.pisteOV .cle { stroke: var(--bl5); stroke-width: 0.3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pisteOV .boule { fill: var(--bl5); }
.pisteOV .halo { fill: none; }
.pisteOV .nt { color: var(--bl5); }
.pisteOV .tete { fill: currentColor; }
.pisteOV .hampe, .pisteOV .signe, .pisteOV .soupir { stroke: currentColor; fill: none; stroke-width: 0.13; stroke-linecap: round; stroke-linejoin: round; }
.pisteOV .soupir { stroke-width: 0.26; }
.pisteOV .signe { stroke-width: 0.14; }
.pisteOV .nt.fait { color: var(--tq5); }
.pisteOV .nt.courant { color: var(--bl4); }
.pisteOV .nt.courant .halo { fill: var(--vt1); }
.pisteOV .nt.courant .tete, .pisteOV .nt.courant .hampe { stroke-width: 0.2; }

/* Les verres */
.grilleOV {
    --n: 8;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(var(--n), 1fr);
    gap: 10px;
    padding: 16px 12px 12px;
    background-color: rgba(255, 255, 255, 0.35);
    border: 5px solid var(--bl4);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(12, 66, 172, 0.4);
}
.grilleOV[data-n="1"] { --n: 1; max-width: 230px; }
.colonne {
    --e1: var(--tq2); --e2: var(--tq5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.colonne:nth-child(4n+2) { --e1: var(--bl1); --e2: var(--bl3); }
.colonne:nth-child(4n+3) { --e1: var(--vt1); --e2: var(--vt4); }
.colonne:nth-child(4n)   { --e1: var(--tq1); --e2: var(--bl2); }
.verre {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.45));
    border: 4px solid var(--bl4);
    border-radius: 6px 6px 24px 24px;
    transition: transform 0.15s, box-shadow 0.2s;
}
.verre:hover { transform: translateY(-3px); }
.eau {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: var(--h, 0%);
    background: linear-gradient(180deg, var(--e1), var(--e2));
    border-top: 3px solid rgba(255, 255, 255, 0.85);
    transition: height 0.4s ease-out;
}
.reflet {
    position: absolute;
    top: 8%; left: 14%;
    width: 12%; height: 55%;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
}
.numero {
    position: absolute;
    top: 5px; right: 7px;
    font-size: 0.8rem;
    font-weight: 900;
    color: var(--bl5);
}
.verre.frappe { animation: vibre 0.45s ease-out; }
.verre.frappe .eau { animation: eclat 0.6s ease-out; }
.verre.attendu { box-shadow: 0 0 0 5px var(--vt3), 0 0 18px 6px rgba(70, 235, 53, 0.7); }
@keyframes vibre {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-4deg); }
    40% { transform: rotate(3deg); }
    60% { transform: rotate(-2deg); }
    80% { transform: rotate(1deg); }
}
@keyframes eclat { 30% { filter: brightness(1.35); } }
.nomNote {
    min-height: 2.2em;
    display: flex;
    align-items: center;
    font-size: clamp(0.7rem, 2.6vw, 1.1rem);
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    color: var(--bl5);
}
.niveaux { display: flex; gap: 6px; }
.niveaux button {
    width: 34px; height: 34px;
    font-size: 1.3rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border: none;
    border-radius: 50%;
    box-shadow: 0 3px 0 var(--bl5);
    cursor: pointer;
}
.niveaux button:disabled { opacity: 0.3; cursor: default; }
.grilleOV.verrouille .niveaux { display: none; }

/* ----- Message et actions ----- */
.panneauOV { width: 100%; max-width: 700px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#messageOV {
    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;
}
#messageOV.ok { background-color: var(--vt1); border: 3px solid var(--vt5); }
#messageOV.ko { color: #fff; background-color: var(--rouge2); border: 3px solid var(--rouge3); }
.actionsOV { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; }
.comprendreOV {
    width: 100%;
    padding: 10px 18px;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.55);
    border: 3px solid var(--tq3);
    border-radius: 20px;
}
.comprendreOV summary { font-weight: 700; cursor: pointer; }
.comprendreOV p { margin-top: 8px; line-height: 1.5; }

/* ----- Téléphone : 2 rangées de 4 verres ----- */
@media (max-width: 560px) {
    .jeuOV { padding: 12px 12px 70px; }
    .carteOV { padding: 20px 14px; }
    .grilleOV[data-n="8"] { --n: 4; row-gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .verre.frappe, .verre.frappe .eau { animation: none; }
    .eau, .verre, .boutonOV { transition: none; }
}

/* ----- Tempo (mode mélodie) ----- */
.tempoOV {
    width: 100%;
    padding: 10px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--bl5);
    font-weight: 700;
    background-color: rgba(255, 255, 255, 0.55);
    border: 3px solid var(--tq3);
    border-radius: 24px;
}
.tempoLigne { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; }
.tempoLigne input[type="range"] { flex: 1 1 180px; min-width: 140px; height: 28px; accent-color: var(--bl4); cursor: pointer; }
.niveauxTempo {
    width: 36px; height: 36px;
    font-size: 1.4rem;
    font-weight: 900;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border: none;
    border-radius: 50%;
    box-shadow: 0 3px 0 var(--bl5);
    cursor: pointer;
}
.niveauxTempo:focus-visible, .tempoLigne input:focus-visible { outline: 4px solid var(--vt4); outline-offset: 3px; }
