/* =========================================
   ▼ 音楽再生・キーボード表示用のスタイル
   ========================================= */

.music-notation-container {
    position: relative;
    margin: 2rem 0;
    width: 100%;
}

/* コントロールパネル */
.music-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 10px;
    padding: 0;
}

.btn-play {
    background-color: #4d7ea8;
    color: white;
    border: 2px solid #4d7ea8;
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
}

/* Inverted/Sunken state when playing */
.btn-play.playing {
    background-color: #355876;
    border-color: #355876;
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: translateY(1px);
}

.btn-play.playing:hover {
    background-color: #2d4b64;
    border-color: #2d4b64;
}

/* キーボード (SVG) */
.keyboard-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-top: 10px;
    padding-bottom: 5px;
    /* for scrollbar visibility */
}

.virtual-keyboard {
    display: block;
    height: 80px;
    background: #2b2b2b;
    padding: 6px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);

    /* Default (Mobile): Ensure wide enough to be usable, triggering scroll */
    min-width: 700px;
}

/* PC/Tablet: Fit to container, no scroll */
@media (min-width: 768px) {
    .virtual-keyboard {
        min-width: auto;
        width: 100%;
    }
}

.key-white {
    fill: #fdfdfd;
    stroke: #ccc;
    stroke-width: 1px;
    transition: fill 0.05s;
}

.key-black {
    fill: #1a1a1a;
    stroke: #000;
    stroke-width: 1px;
    transition: fill 0.05s;
}

/* 光る演出 (Pokemon/Retro like) */
.key-white.active {
    fill: #ffdd44 !important;
    filter: drop-shadow(0 0 5px rgba(255, 221, 68, 0.8));
}

.key-black.active {
    fill: #ffaa00 !important;
    filter: drop-shadow(0 0 5px rgba(255, 170, 0, 0.8));
}

/* スコアハイライト (音符の光り) */

/* VexFlowのSVG要素に対するスタイル */
/* 通常時 */
.vf-stavenote {
    transition: fill 0.1s, stroke 0.1s;
}

/* ハイライト時 */
.note-highlight {
    fill: #e63946 !important;
    stroke: #e63946 !important;
    /* 光るアニメーション */
    filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.6));
    animation: pulse-note 0.5s ease-out;
}

@keyframes pulse-note {
    0% {
        filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.9));
        transform: scale(1.1);
    }

    100% {
        filter: drop-shadow(0 0 4px rgba(230, 57, 70, 0.6));
        transform: scale(1);
    }
}

/* スクロール追従のためのラッパー */
.score-scroll-wrapper {
    overflow-x: auto;
    width: 100%;
    padding-bottom: 10px;
    scroll-behavior: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fff;
}

/* Ensure SVG text (lyrics, chords, etc.) uses the theme text color */
.music-notation-container svg text {
    fill: var(--color-text, #333) !important;
    font-family: var(--font-base, sans-serif) !important;
}