/* 音符高亮樣式 */
.highlight {
    fill: #ff0000 !important;    /* 變紅色 */
    stroke: #ff0000 !important;
    transition: fill 0.1s ease;  /* 加少少過渡效果聽落更順 */
}

.note {
    transition: fill 0.1s;
}

#scoreDiv {
    text-align : center;
}

#scoreDiv:fullscreen {
    background-color: white !important; /* 必須設為白色，否則會變黑屏 */
    width: 100vw;
    height: 100vh;
    overflow: clip;
    padding: 20px;
    box-sizing: border-box;
}

/* 針對 Safari 的相容性設定 */
#scoreDiv:-webkit-full-screen {
    background-color: white !important;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto !important;
    height: -webkit-fill-available; 

    /* 處理安全區域，確保背景延伸到底部 */
    padding-bottom: env(safe-area-inset-bottom);
}

@font-face {
    font-family: "BroadwayWeb";
    src: url("/wp-content/uploads/fonts/FinaleBroadwayText.otf") format("opentype");
}

@font-face {
    font-family: "LelandWeb";
    src: url("/wp-content/uploads/fonts/LelandText.otf") format("opentype");
}

svg g.pgHead {
    font-family: "LelandWeb";
    padding-bottom: 20px;
}

svg g.label {
    display: none;
}
svg g.labelAbbr {
    display: none;
}
g.note.playing {
    fill: crimson;
}


svg g.harm tspan:not([font-family]) {
    font-family: "BroadwayWeb";
}

svg g.reh tspan {
    font-family: "BroadwayWeb";
}

svg g.syl tspan {
    font-family: "LelandWeb";
}

/* 保持 music font */
svg g.harm tspan[font-family="Leipzig"] {
    font-family: "Leipzig";
}

@media print {

    @font-face {
		font-family: "BroadwayWeb";
		src: url("/wp-content/uploads/fonts/FinaleBroadwayText.otf") format("opentype");
	}

    @font-face {
		font-family: "LelandWeb";
		src: url("/wp-content/uploads/fonts/LelandText.otf") format("opentype");
	}
    
    @page { 
        margin: 0 !important; 
        size: A4; 
    }
    html, body {
        margin: 0mm !important;
        padding: 0 !important;
        background: white !important;
        background-color: white !important;
        width: 210mm !important;
        height: 297mm !important;
    }
    /* body > *:not(#print-container) { 
        display: none !important; 
        background: white !important;
        background-color: white !important;
    } */
    #print-container { 
        display: block !important; 
        width: 210mm !important; 
        background: white !important;
        background-color: white !important;
    }
    .print-page { 
        page-break-after: always;
        padding-top: 10mm;
        padding-right: 10mm;
        padding-bottom: 10mm;
        padding-left: 5mm;
        box-sizing: border-box;
        width: 210mm !important;
        height: 297mm !important;
        background: white !important;
        background-color: white !important;
    }
    svg { 
        width: 100% !important; 
        height: 100% !important; 
        transform: scale(1.28); 
        transform-origin: top left;
    }

    body.iPad {
        margin-top: -10mm !important;
        margin-left: -1mm !important;
        margin-right: -1mm !important;
    }
    body.iPad .print-page { 
        page-break-after: always;
        padding: 0mm;
        box-sizing: border-box;
        width: 210mm !important;
        height: 297mm !important;
        background: white !important;
        background-color: white !important;
    }

    body.iPad svg { 
        width: 100% !important; 
        height: 100% !important; 
        transform: scale(1.2); 
        transform-origin: top left;
    }

    body.iPhone .print-page { 
        page-break-after: always;
        padding: 0mm;
        box-sizing: border-box;
        width: 210mm !important;
        height: 297mm !important;
        background: white !important;
        background-color: white !important;
    }

    body.iPhone {
        margin-top: -10mm !important;
        margin-left: -1mm !important;
        margin-right: -1mm !important;
    }
    body.iPhone svg { 
        width: 100% !important; 
        height: 100% !important; 
        transform: scale(1.2); 
        transform-origin: top left;
    }

    .modern-menu { 
        display: none !important; 
    }

    svg g.pgHead {
        font-family: "LelandWeb";
        padding-bottom: 20px;
    }
    
    svg g.label {
        display: none;
    }
    svg g.labelAbbr {
        display: none;
    }
    g.note.playing {
        fill: crimson;
    }
	
	
	svg g.harm tspan:not([font-family]) {
		font-family: "BroadwayWeb";
	}

    svg g.reh tspan {
        font-family: "BroadwayWeb";
    }

    svg g.syl tspan {
        font-family: "LelandWeb";
    }

	/* 保持 music font */
	svg g.harm tspan[font-family="Leipzig"] {
		font-family: "Leipzig";
	}
    
}

@media screen {
    #print-container { 
        visibility: hidden;
        height: 0; overflow: hidden;
    }
}
    
@media (pointer: coarse) {
    #prePage, #nextPage, #saveMSCZ {
        display: none;
    }
}



.modern-menu {
    display: inline-flex; /* 根據內容闊度自動調整 */
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px); /* 毛玻璃關鍵 */
    -webkit-backdrop-filter: blur(15px);
    border-radius: 5px; /* 膠囊形狀 */
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    top: 10px;
    left: 50%;
    z-index: 1000;
    transition: all 0.3s ease;
    margin: 0 auto;
    white-space: nowrap;
    
    
}

/* 設置 Icon 嘅大細同粗細 */
.material-symbols-rounded {
    font-variation-settings: 'wght' 300, 'opsz' 24; /* 300 係幼線條，比較高級 */
    font-size: 24px;
}

.btn-tool {
    width: 30px !important;
    height: 30px;
    min-width: 30px;    
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    background: transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    color: #333;
}

/* Hover 效果 */
.btn-tool:hover {
    background: #007AFF;
    transform: scale(1.05);
}

/* Print 掣特別色 */
.btn-tool.primary {
    background: #007AFF;
    color: white;
}

.btn-tool.primary:hover {
    background: #0056b3;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
}

/* 音樂符號稍微較大啲 */
.btn-tool {
    font-size: 18px; 
}

.pagination-group {
    display: flex;          /* 強制變做橫排 */
    align-items: center;    /* 垂直置中 */
    justify-content: center;/* 水平置中 */
    flex-wrap: nowrap;      /* 絕對唔准分行 */
    border-radius: 30px;
    padding: 2px 4px;       /* 稍微縮細 padding 等佢唔好太闊 */
    gap: 4px;               /* 控制 Icon 同數字之間嘅距離 */
}

.mscz-download-btn {
    /* 基礎設定 */
    display: inline-flex !important;
    flex-direction: column !important; /* 強制垂直排列 */
    align-items: center !important;
    justify-content: center !important;
    
    /* 尺寸與外觀 */
    height: 25px !important;
    width: 45px !important;
    text-decoration: none !important;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 0 !important;
    color: #333 !important;
}

/* 針對移動裝置優化 */
.modern-menu input[type="number"]:focus {
    border-color: #007aff; /* 點擊時變色 */
    background: #fff;
}

#metronome.metronome-beat {
    animation: metronomeFlash 0.12s ease-out;
}

@keyframes metronomeFlash {
    0% {
        transform: scale(1.2);
        opacity: 1;
        background-color: #007AFF;
        color: white;
    }

    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}