/* --- 基本レイアウト --- */
body {
    font-family: sans-serif;
    background-color: #333; /* ベースカラー */
    color: #f1f1f1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 20px;
}

h1 {
    font-weight: normal;
    letter-spacing: 2px;
    margin-bottom: 25px;
    color: #eee;
}

/* --- 操作パネル --- */
.controls {
    display: flex;
    align-items: center;
    background-color: #222;
    padding: 15px 25px;
    border-radius: 8px;
    border: 1px solid #444;
    margin-bottom: 25px;
}

#play-stop-button {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    background-color: #e6646e; /* TR-808風の赤色 */
}

#play-stop-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#play-stop-button.playing {
    background-color: #e6a864; /* TR-808風のオレンジ */
}

.tempo-control {
    display: flex;
    align-items: center;
    font-size: 16px;
    margin-left: 25px;
}

#tempo {
    margin-left: 10px;
    width: 150px;
}

/* --- シーケンサー --- */
#sequencer-container {
    display: flex;
    background-color: #e0e0e0; /* 明るいグレーのパネル */
    padding: 20px;
    border-radius: 8px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid #555;
    align-items: center; /* 中央揃え */
}

#track-labels {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-right: 15px;
}

.track-label {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    background-color: #ccc;
    border-radius: 4px;
    padding: 0 10px;
    white-space: nowrap;
    border: 1px solid #aaa;
}

#sequencer {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 5px;
    padding-right: 15px;
    border-right: 2px solid #aaa;
}

.step {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #bbb;
    border-radius: 50%; /* 丸形 */
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: inset 0 2px 3px rgba(0,0,0,0.2);
}

/* ▼▼▼ ここに新しいスタイルを追加 ▼▼▼ */
.step[data-step="0"],
.step[data-step="4"],
.step[data-step="8"],
.step[data-step="12"] {
    background-color: #ffe8d6; /* 薄いオレンジ色 */
}


.step:hover {
    background-color: #f0f0f0;
}

.step.active {
    background-color: #e6646e; /* TR-808風の赤色 */
}

.step.current {
    outline: 2px solid #333;
    outline-offset: 1px;
}

.step.active.current {
    background-color: #e6a864; /* TR-808風のオレンジ */
    outline-color: #000;
}

/* --- ミュートボタンのスタイル --- */
#mute-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: 15px;
}

.mute-button {
    width: 40px;
    height: 40px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background-color: #bbb; /* 通常時の色 */
    border: 1px solid #999;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.mute-button.muted {
    background-color: #e6646e; /* ミュート時の色 (赤) */
    color: #fff;
}

/* --- 説明文のスタイル --- */
.instructions {
    background-color: #444;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 10px 25px;
    margin-bottom: 25px;
    max-width: 800px;
}

.instructions h2 {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 15px;
    color: #eee;
    font-size: 18px;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.instructions li {
    margin-bottom: 8px;
    font-size: 14px;
    color: #ddd;
}

/* --- ▼▼▼ スマートフォン向けのスタイル (画面幅850px以下で適用) ▼▼▼ --- */
@media (max-width: 850px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .instructions {
        margin-bottom: 15px;
        padding: 5px 15px;
    }

    .instructions h2 {
        font-size: 16px;
    }

    .instructions li {
        font-size: 12px;
    }

    #sequencer-container {
        padding: 10px;
    }

    /* --- ボタン類を大きくする --- */
    .step {
        width: 24px;   /* 18pxから24pxに変更 */
        height: 24px;  /* 18pxから24pxに変更 */
    }

    .track-label {
        height: 24px;  /* 18pxから24pxに変更 */
        font-size: 9px;
        padding: 0 5px;
    }

    .mute-button {
        width: 24px;   /* 18pxから24pxに変更 */
        height: 24px;  /* 18pxから24pxに変更 */
        font-size: 11px; /* 9pxから11pxに変更 */
    }

    #track-labels, #mute-buttons, #sequencer {
        gap: 5px; /* ボタン間の隙間を調整 */
    }
}