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

html,
body {
    height: 100%;
    overflow: hidden;
    display: contents;

    font-family: Arial, sans-serif;
    background-color: rgb(255, 255, 255);
}


#container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

header:not(.header-modern) {
    width: 100%;
    flex: 0 1 6vw;
    background-color: rgb(255, 255, 255);
    padding: 0px;
    margin: 0px;
    z-index: 10;
    position: relative;
    display: flex;
    align-items: center;
    /* Centre verticalement les enfants */
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
}

.erreurs {
    background-color: rgb(203, 203, 203);
    padding: 0px;
    margin: 0px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    z-index: 5;
    flex: 0 1 2vw;
    /* Remplacez 20% par le ratio souhaité pour la partie 1 */
}

#chord {
    position: relative;
    margin-top: -2vw;
    z-index: 2;
    transform: scale(1, 1);
    background-color: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    top: -3.5vw;
    flex: 0 1 40vw;

    font-size: xxx-large;
    text-align: center;
}

#sheet-container {
    position: relative;
    margin-top: -1vw;
    z-index: 2;
    background-color: rgb(255, 255, 255);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-left: auto;
    margin-right: auto;
    top: -2.5vw;
    flex: 0 1 40vw;
}

#sheet {
    position: relative;
    transform: scale(1, 1);
    background-color: rgb(255, 255, 255);
}

/* Curseur de cadence */
#cadence-cursor {
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom,
        rgba(59, 130, 246, 0.3) 0%,
        rgba(59, 130, 246, 0.9) 30%,
        rgba(59, 130, 246, 0.9) 70%,
        rgba(59, 130, 246, 0.3) 100%);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
    z-index: 10;
    display: none;
    pointer-events: none;
    transition: none;
}

#cadence-cursor.active {
    display: block;
}

/* Indicateur de note courante (mode sans cadence) */
#note-indicator {
    position: absolute;
    top: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to bottom,
        rgba(34, 197, 94, 0.1) 0%,
        rgba(34, 197, 94, 0.4) 30%,
        rgba(34, 197, 94, 0.4) 70%,
        rgba(34, 197, 94, 0.1) 100%);
    border-left: 3px solid rgba(34, 197, 94, 0.8);
    border-right: 3px solid rgba(34, 197, 94, 0.8);
    z-index: 5;
    display: none;
    pointer-events: none;
    transform: translateX(-35%);
    transition: left 0.3s ease-out;
}

#note-indicator.active {
    display: block;
}

/* Masquer la barre de progression en mode libre */
#progressContainer2.hidden {
    visibility: hidden;
}

/* Desktop: partition plus grande */
@media (min-width: 1024px) {
    #sheet-container {
        flex: 1 1 auto;
        margin-top: 0;
        top: 0;
        transform: scale(1.3);
        transform-origin: center center;
        z-index: 1;
    }
}

#progressContainer2 {
    z-index: 4;
    position: relative;
    width: 50%;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    top: 10px;
    flex: 0 1 1vw;
    background-color: rgba(246, 0, 0, 0.4);
}

.groupe-piano {
    z-index: 5;
    width: 100%;
    /* La largeur totale du clavier */
    background-color: grey;
    /* Zoom de 50% */
    transform-origin: bottom center;
    /* Point d'origine du zoom */
    padding-top: 5em;
    /* Point d'origine du zoom */
    width: 100%;
    flex: 0 1 10vw;
}

.gp {

    padding-top: 7em;
    flex: 0 1 10vw;
    /* Conteneur pour le clavier */
}

.ContSlider2 {
    position: absolute;
    transform: scale(1, 0.5);
    padding: 0;
    top: -20px;
    width: 100%;
    padding-bottom: 0px;
    margin-bottom: 0px;
    margin-left: auto;
    margin-right: auto;
    z-index: 2;
}

.piano {
    transform: scale(1, 1);
    position: absolute;
    bottom: -0.2vw;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    background-color: rgb(119, 119, 119);
    z-index: 1;
    height: 100%;
}

.flex-container2 {
    transform: scale(1, 0.85);
    background-color: rgb(255, 255, 255);
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    left: 2%;
    z-index: 6;
    gap: 15px;
    flex: 0 1 6vw;
}

#overlayDiv {
    position: fixed;
    display: none;
    /* Utilisez fixed pour s'assurer qu'il reste centré même lors du scroll */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Centre le div précisément */
    z-index: 1000;
    /* S'assure qu'il est au-dessus de tout autre contenu */

    /* Styles additionnels pour la démonstration */
    background-color: transparent;
    /* Fond semi-transparent pour l'effet overlay */
    text-align: center;
    /* Centrer le texte à l'intérieur */
    width: 80%;
    /* ou une largeur fixe, selon le besoin */
    max-width: 400px;
    /* Largeur maximale */
}

/* Icône double clé pour mode alternance */
.dual-clef-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0px;
    margin-right: 4px;
}

.dual-clef-icon img {
    opacity: 0.8;
}

/* Contrôle de vitesse */
.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.speed-slider {
    width: 80px;
    height: 6px;
}

.speed-value {
    font-size: 0.75rem;
    color: #666;
    min-width: 32px;
    text-align: center;
}

/* Mode alternance actif - highlight des clés */
.header-clef.alternance-active .clef-btn {
    opacity: 0.5;
    pointer-events: none;
}

.header-clef.alternance-active .clef-btn.current-clef {
    opacity: 1;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.6);
}

/* ==================== NOTIFICATION FIN DE SESSION (commun) ==================== */
.session-end-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.session-end-notification.visible {
    opacity: 1;
    pointer-events: auto;
}

.session-end-content {
    text-align: center;
    color: white;
    padding: 40px;
    animation: sessionEndPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes sessionEndPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.session-end-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.session-end-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f97316;
}

.session-end-message {
    font-size: 20px;
    margin-bottom: 24px;
    opacity: 0.9;
}

.session-end-score {
    font-size: 4rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.session-end-percent {
    font-size: 1.5rem;
    opacity: 0.8;
    margin-bottom: 16px;
}

.session-end-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.session-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 16px 24px;
    border-radius: 12px;
    min-width: 80px;
}

.session-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.session-stat .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-top: 4px;
}

.session-stat.miss .stat-value {
    color: #ef4444;
}

.session-stat.extra .stat-value {
    color: #f59e0b;
}

.session-end-extra-info {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-top: 8px;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.session-end-countdown {
    margin-top: 20px;
    font-size: 1.5rem;
    color: #999;
    font-weight: 500;
}

.session-end-button {
    margin-top: 20px;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.session-end-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.session-end-button.score-high {
    background: #22c55e;
}

.session-end-button.score-medium {
    background: #f59e0b;
}

.session-end-button.score-low {
    background: #ef4444;
}

@media (max-width: 480px) {
    .session-end-content {
        padding: 24px;
    }

    .session-end-icon {
        font-size: 48px;
    }

    .session-end-score {
        font-size: 3rem;
    }

    .session-end-stats {
        gap: 12px;
    }

    .session-stat {
        padding: 12px 16px;
        min-width: 70px;
    }

    .session-stat .stat-value {
        font-size: 22px;
    }
}

