.music-memory-keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.music-key {
    width: 60px;
    height: 200px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.3),
        0 6px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
    user-select: none;
    position: relative;
    overflow: hidden;
}

.music-key:nth-of-type(1) {
    height: 200px;
}

.music-key:nth-of-type(2) {
    height: calc(200px - 15px);
}

.music-key:nth-of-type(3) {
    height: calc(200px - 30px);
}

.music-key:nth-of-type(4) {
    height: calc(200px - 45px);
}

.music-key:nth-of-type(5) {
    height: calc(200px - 60px);
}

.music-key:nth-of-type(6) {
    height: calc(200px - 75px);
}

.music-key:nth-of-type(7) {
    height: calc(200px - 90px);
}

.music-key:nth-of-type(8) {
    height: calc(200px - 105px);
}

.music-key::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent);
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.music-key:hover:not(.disabled) {
    transform: translateY(-3px);
    box-shadow:
        0 7px 0 rgba(0, 0, 0, 0.3),
        0 10px 25px rgba(0, 0, 0, 0.3),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.music-key:active:not(.disabled),
.music-key.flash {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.3),
        0 3px 10px rgba(0, 0, 0, 0.2),
        inset 0 2px 10px rgba(255, 255, 255, 0.3);
}

.music-key.flash {
    animation: key-flash 0.3s ease;
}

@keyframes key-flash {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.5);
    }
}

.music-key.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.key-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.key-note {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
}

/* ============ SEQUENCE DOTS ============ */
.sequence-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    min-height: 50px;
}

.music-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
}

.music-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.music-dot.active {
    border-color: white;
    transform: scale(1.4);
    box-shadow: 0 0 15px currentColor;
    z-index: 2;
}

.music-dot.played {
    opacity: 0.4;
    transform: scale(0.85);
}

.music-dot.current {
    border-color: #64b5f6;
    animation: pulse 1s infinite;
}

.music-dot.correct {
    background: #43a047 !important;
    border-color: #66bb6a;
    transform: scale(1.1);
}

.music-dot.wrong {
    background: #e53935 !important;
    border-color: #ef5350;
    animation: shake 0.4s ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(30, 136, 229, 0);
    }

    50% {
        transform: scale(1.15);
        box-shadow: 0 0 10px rgba(30, 136, 229, 0.6);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    75% {
        transform: translateX(4px);
    }
}

.progress-text {
    font-size: 14px;
    color: #aaa;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ============ SYLLABLE DISPLAY ============ */
.syllable-display {
    text-align: center;
    margin: 1rem 0;
    min-height: 3.5rem;
}

.syllable-window {
    display: inline-flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fff9c4, #fff176);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.syllable-text {
    font-weight: bold;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    min-width: 50px;
    text-align: center;
    transition: all 0.2s ease;
}

.syllable-text.active {
    color: #333;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.syllable-text.upcoming {
    color: #666;
    opacity: 0.7;
}


@media (max-width: 570px) {
    .music-key {
        width: 36px;
    }
}