/* ポップアップ */
.overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.3s;
    z-index: 1000;
}

.overlay.active {
    /* ポップアップを開いたときに、背後を半透明の黒背景で覆う */
    visibility: visible;
    opacity: 1;
}

.popup {
    background-color: white;
    border-radius: 10px;
    padding: 2rem 0rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #555;
}


/* 背景の色 */
.bg-gray-50 {
    background-color: #F9FAFB;
}

/* ヘッダーの色 */
.bg-gray-900 {
    background-color: #111827;
}

/* ボタンのホバー効果 */
button:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}

button:active {
    transform: scale(0.95);
}

/* 簡単3ステップアイコンのホバー効果 */
.rounded-full:hover {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* アニメーション効果　画面が下からふわっと表示される*/
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    animation: fadeIn 0.5s ease-out;
}

/* ボタン間のスペース */
.button-group button {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* ボタン内のテキスト改行用 */
.button-text {
    display: inline-block;
    text-align: center;
    line-height: 1.2;
}

/* 録音中のボタン */
button.disabled {
    opacity: 0.5;
    /* ボタンの透明度を半透明に */
    pointer-events: none;
    /* ボタン無効化 */
    transition: opacity 0.3s ease;
    /* ボタン変化を0.3secかけて滑らかに */
}


/* 結果セクションのスタイル */
#results-section {
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.animate-fade-in {
    animation: fade-in 0.4s ease-out;
}

/* 測定ステップ表示 */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0.25rem 0 0.75rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.step .circle {
    width: 38px;
    height: 38px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d1d5db;
    background: #fff;
}

.step .label {
    margin-top: 6px;
    font-weight: 600;
}

.connector {
    width: 16px;
    height: 2px;
    background: #d1d5db;
}

/* 低音アクティブ */
.step.active .circle {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.step.active .label {
    color: #1f2937;
}

/* 高音アクティブ */
.step.high-active .circle {
    border-color: #dc2626;
    color: #dc2626;
    background: #fef2f2;
}

.step.high-active .label {
    color: #1f2937;
}

/* 完了 */
.step.done .circle {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.step.done .label {
    color: #10b981;
}

.step.done+.connector {
    background: #10b981;
}

/* フェーズバッジ */
.phase-badge {
    margin: 4px auto 8px;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 600;
    width: fit-content;
}

.badge-low {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-high {
    background: #fee2e2;
    color: #b91c1c;
}

/* リクエストによりフェーズ文言を非表示 */
.phase-badge {
    display: none !important;
}

/* キーワード色分け */
.word-low {
    color: #1d4ed8;
    font-weight: 600;
}

.word-high {
    color: #b91c1c;
    font-weight: 600;
}

/* ポップアップ内のstep1～step3 */
.step {
    width: 96px;
}

.step .circle {
    margin: 0 auto;
}

.step .label {
    display: block;
    text-align: center;
    white-space: nowrap;
}



/* 鍵盤ビジュアル */
.keyboard-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
    /* スクロールバーと重ならないように少し余白（お好みで） */
}

.keyboard-wrapper {
    display: inline-block;
    padding: 20px;
    background: #fff;
    /* 背景の色 */
    min-width: 640px;
}

.keyboard {
    position: relative;
    display: flex;
    align-items: flex-start;
    height: 160px;
}

.white-key {
    position: relative;
    width: 40px;
    height: 160px;
    border: 1px solid #000;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    font-size: 14px;
}

/* 白鍵の文字（A,B,C,...） */
.white-key span {
    margin-bottom: 5px;
    pointer-events: none;
}

.black-key {
    position: absolute;
    top: 0;
    right: -13px;
    /* 右隣の白鍵側に少しはみ出させる */
    width: 24px;
    height: 90px;
    background: #000;
    border-radius: 0 0 4px 4px;
    z-index: 2;
}

.white-key.out-of-range {
    background: #dcdcdc;
    border-color: #9a9a9a;
    color: #777;
}

.black-key.out-of-range {
    background: #777;
    opacity: 0.35;
}

/* 鍵盤のすぐ下に並べるlow~hihiの帯 */
.ranges {
    display: flex;
    margin-top: 0;
    font-size: 14px;
}

.range {
    flex: 1;
    text-align: center;
    padding: 4px 0;
    border: 1px solid #ccc;
    box-sizing: border-box;
    font-weight: 600;
}

.range-low {
    background: #cfe8ff;
}

.range-mid1 {
    background: #d4f0d4;
}

.range-mid2 {
    background: #fff3bf;
}

.range-hi {
    background: #ffd6cc;
}

.range-hihi {
    background: #f3c4ff;
}

/* 男性平均と女性平均*/
.MaleRange,
.FemaleRange {
    position: relative;
    height: 0;
    margin-top: 16px;
    /* 上との距離だけ固定 */
    border-top: 2px solid currentColor;
    /* solid currentColor:線の色 = 文字色 */
}

.MaleRange {
    color: #2600ff;
}

/* 男性平均ラインの色（青） */
.FemaleRange {
    color: #fd0000;
    /* 女性平均ラインの色（赤） */
    margin-top: 30px;
    /* 男性平均との縦の間隔 */
}

.MaleRange.label::before,
.MaleRange.label::after,
.FemaleRange.label::before,
.FemaleRange.label::after {
    /* 両端の矢印（共通） */
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.MaleRange.label::before,
.FemaleRange.label::before {
    /* 左矢印（共通） */
    left: -10px;
    /*三角形の位置：線の左端を0として-10px*/
    border-right: 10px solid currentColor;
    /*三角形の幅：10px*/
}

.MaleRange.label::after,
.FemaleRange.label::after {
    /* 右矢印（共通） */
    right: -10px;
    /*三角形の位置：線の右端を0として-10px*/
    border-left: 10px solid currentColor;
}

.MaleRange.label span,
.FemaleRange.label span {
    /* 中央のテキスト（共通） */
    position: absolute;
    top: -0.9em;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 0 4px;
    font-size: 15px;
}
