/**
 * Subdivisions rythmiques — « Ressentir le rythme »
 */

.cdm-player__subdivisions-panel {
    margin: 0.5rem 0 0.35rem;
    border: 1px solid rgba(30, 58, 95, 0.12);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255, 252, 245, 0.98) 0%, rgba(248, 244, 235, 0.95) 100%);
}

.cdm-player__subdivisions-summary {
    padding: 0.65rem 0.85rem;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cdm-navy, #1e3a5f);
    cursor: pointer;
    list-style: none;
}

.cdm-player__subdivisions-summary::-webkit-details-marker {
    display: none;
}

.cdm-player__subdivisions-body {
    padding: 0 0.85rem 0.85rem;
}

.cdm-player__subdivisions-lead {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--cdm-muted, #5a6b7d);
    font-style: italic;
}

.cdm-player__rhythm-cells {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 0.65rem;
    max-width: 100%;
}

.cdm-rhythm-cell {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.65rem 0.55rem 0.55rem;
    border-radius: 8px;
    border: 1px solid rgba(232, 163, 23, 0.22);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 1px 4px rgba(30, 58, 95, 0.06);
}

.cdm-rhythm-cell.is-cell-pulsing {
    box-shadow: 0 0 0 2px rgba(232, 163, 23, 0.55);
    transform: scale(1.02);
    transition: box-shadow 0.08s ease, transform 0.08s ease;
}

.cdm-rhythm-cell__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.4rem;
}

.cdm-rhythm-cell__title {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--cdm-navy, #1e3a5f);
}

.cdm-rhythm-cell__technical {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.03em;
    color: rgba(90, 107, 125, 0.85);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: rgba(30, 58, 95, 0.06);
}

.cdm-rhythm-cell__diff {
    margin-left: auto;
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--cdm-gold, #e8a317);
}

.cdm-rhythm-cell__visual {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.2rem;
    min-height: 1.75rem;
    padding: 0.25rem 0;
}

.cdm-rhythm-cell__visual--blocks .cdm-rhythm-cell__block {
    display: inline-block;
    height: 0.55rem;
    border-radius: 3px;
    background: rgba(30, 58, 95, 0.15);
}

.cdm-rhythm-cell__visual--blocks .cdm-rhythm-cell__block--fill {
    width: 1.35rem;
    background: var(--cdm-gold, #e8a317);
}

.cdm-rhythm-cell__visual--blocks .cdm-rhythm-cell__block--stretch {
    width: 2.4rem;
    background: linear-gradient(90deg, var(--cdm-gold, #e8a317) 0%, rgba(232, 163, 23, 0.35) 100%);
}

.cdm-rhythm-cell__visual--blocks .cdm-rhythm-cell__block--empty {
    width: 0.65rem;
    opacity: 0.25;
}

.cdm-rhythm-cell__visual--dots .cdm-rhythm-cell__dot,
.cdm-rhythm-cell__visual--shimmer .cdm-rhythm-cell__dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: rgba(30, 58, 95, 0.2);
}

.cdm-rhythm-cell__visual--dots .cdm-rhythm-cell__dot--fill,
.cdm-rhythm-cell__visual--shimmer .cdm-rhythm-cell__dot--fill {
    background: var(--cdm-gold, #e8a317);
    transform: scale(1.15);
}

.cdm-rhythm-cell__visual--dots .cdm-rhythm-cell__dot--soft,
.cdm-rhythm-cell__visual--shimmer .cdm-rhythm-cell__dot--soft {
    background: rgba(232, 163, 23, 0.55);
    transform: scale(0.85);
}

.cdm-rhythm-cell__visual--dots .cdm-rhythm-cell__dot--accent {
    background: #c65a5a;
    box-shadow: 0 0 0 1px rgba(198, 90, 90, 0.35);
    transform: scale(1.2);
}

.cdm-rhythm-cell__visual--dots .cdm-rhythm-cell__dot--empty {
    opacity: 0.2;
    transform: scale(0.65);
}

.cdm-rhythm-cell__visual--triplet .cdm-rhythm-cell__triplet {
    display: inline-flex;
    gap: 0.12rem;
    margin-right: 0.2rem;
}

.cdm-rhythm-cell__feeling {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cdm-text-strong, #2a3d52);
    line-height: 1.35;
}

.cdm-rhythm-cell__feeling-mark {
    color: var(--cdm-gold, #e8a317);
    font-weight: 400;
}

.cdm-rhythm-cell__dance {
    margin: 0;
    font-size: 0.72rem;
    color: var(--cdm-muted, #5a6b7d);
    line-height: 1.35;
}

.cdm-rhythm-cell__instruments {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cdm-rhythm-cell__inst-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.08);
    color: var(--cdm-navy, #1e3a5f);
}

.cdm-rhythm-cell__actions {
    margin-top: 0.15rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
}

.cdm-rhythm-cell.is-cell-compare {
    outline: 2px dashed rgba(30, 58, 95, 0.45);
    outline-offset: 2px;
    background: rgba(255, 252, 245, 0.95);
}

.cdm-player__btn--cell-listen {
    grid-column: 1 / -1;
    min-height: 40px;
    font-size: 0.78rem;
    font-weight: 700;
    touch-action: manipulation;
}

.cdm-player__btn--cell-loop,
.cdm-player__btn--cell-compare {
    min-height: 40px;
    font-size: 0.72rem;
    font-weight: 700;
    touch-action: manipulation;
}

.cdm-player__btn--cell-loop.is-looping {
    background: rgba(232, 163, 23, 0.25);
    border-color: rgba(232, 163, 23, 0.65);
}

.cdm-rhythm-cell.is-cell-active {
    border-color: rgba(232, 163, 23, 0.65);
    background: rgba(255, 243, 214, 0.55);
}

.cdm-rhythm-cell.is-cell-exercise-focus {
    outline: 2px solid rgba(232, 163, 23, 0.75);
    outline-offset: 2px;
    background: rgba(255, 243, 214, 0.72);
}

@media (prefers-reduced-motion: reduce) {
    .cdm-rhythm-cell.is-cell-pulsing {
        transform: none;
        transition: none;
    }
}

@media (max-width: 480px) {
    .cdm-player__subdivisions-panel:not([open]) {
        margin-bottom: 0.35rem;
    }

    .cdm-player__rhythm-cells {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .cdm-player__btn--cell-listen,
    .cdm-player__btn--cell-loop,
    .cdm-player__btn--cell-compare {
        min-height: 44px;
    }
}

@media (min-width: 900px) {
    .cdm-player__rhythm-cells {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
