.sync-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明の背景 */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: syncFadeIn 0.3s;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    color: #333;
}

@keyframes syncFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sync-modal-content {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    max-height: 85%;
    width: 90%;
    position: relative;
    overflow-y: auto;
    animation: syncSlideIn 0.3s;
}

@keyframes syncSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.sync-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.sync-close:hover {
    color: #000;
}

/* 簡単入力インターフェース */
.sync-input-container {
    background-color: #c4c1c1;
    margin-top: 15px;
    position: relative;
    padding-bottom: 10px;
    overflow-y: auto;
    max-height: 300px;
    border: solid 2px grey;
}

.sync-beat-row {
    display: flex;
    align-items: center;
    margin: 5px 3px;
    padding: 2px;
    background-color: #ffffff;
    border-radius: 5px;
    position: relative;
}

.sync-hand-inputs {
    display: flex;
    gap: 2px;
    flex: 1;
    flex-wrap: wrap;
}

.sync-hand-group {
    display: flex;
    align-items: center;
    gap: 3px;
    flex: 1;
    min-width: 110px;
    position: relative;
    justify-content: center;
}

.sync-hand-label {
    font-weight: 500;
    color: #666;
}

.sync-throw-input {
    width: 50px !important;
    padding: 8px 4px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    text-align: center !important;
    font-size: 16px !important;
}

.sync-throw-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.sync-cross-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.sync-cross-label {
    cursor: pointer;
    user-select: none;
    color: #666;
    font-size: 14px;
}

.sync-cross-label.disabled {
    cursor: not-allowed;
    color: #ccc;
}

.sync-multiplex-notice {
    display: none;
    font-size: 10px;
    color: #ff9800;
    white-space: nowrap;
    position: absolute;
    top: 0px;
    left: 0px;
    background-color: #fff8e1;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ffcc80;
    z-index: 5;
    pointer-events: none;
}

.sync-checkbox-wrapper {
    position: relative;
    display: inline-block;
}

.sync-control-buttons {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.sync-control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.sync-add-beat-between {
    position: absolute;
    bottom: -15px;
    left: calc(50% - 20px);
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    border: none;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sync-add-beat-between:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.duplicate-btn {
    position: absolute;
    bottom: -15px;
    left: calc(50% + 20px);
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #FF9800;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.duplicate-btn:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.sync-generate-btn {
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
}

.sync-generate-btn:hover {
    background-color: #45a049;
}

.swap-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-right: 10px;
    flex-shrink: 0;
}

.swap-btn {
    width: 28px;
    height: 24px;
    border: 1px solid #ddd;
    background-color: white;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border-radius: 4px;
    transition: all 0.2s;
}

.swap-btn:hover:not(:disabled) {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #2196F3;
}

.swap-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.sync-pattern-display {
    margin: 2px;
    padding: 2px;
    background-color: #e8f5e9;
    border-radius: 5px;
    font-size: 18px;
    text-align: center;
    word-break: break-all;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sync-info-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.sync-short-label {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    text-align: center;
}

.sync-modal-title{
    margin: 2px;
}

body.modal-open {
    overflow: hidden;
}

button{
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

.sync-hand-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}


.swap-down-btn {
    background-color: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    margin-left: 5px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.swap-down-btn:hover {
    background-color: #0b7dda;
}

.sync-hand-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Beat入れ替えボタン */
.swap-beat-btn {
    position: absolute;
    bottom: -15px;
    left: 22px;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #673AB7;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.3s;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.swap-beat-btn:hover {
    opacity: 1;
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    background-color: #512DA8;
}

/* アクションボタンのコンテナ */
.sync-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}

/* RとL入れ替えボタン（新スタイル） */
.sync-swap-rl-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #2196F3;
    color: white;
    border: none;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.sync-swap-rl-btn:hover {
    background-color: #1976D2;
    transform: scale(1.1);
}

/* 削除ボタンのスタイル調整（既存のスタイルを上書き） */
.sync-delete-btn {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #f44336;
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
    margin-left: 0; /* margin-left: 5px; を削除 */
}

.sync-delete-btn:hover {
    background-color: #d32f2f;
    transform: scale(1.1);
}

/* ボタン説明セクション */
.sync-button-descriptions {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.sync-descriptions-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

.sync-descriptions-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-description-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px;
    background-color: white;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

.sync-description-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
}

/* 各ボタンのアイコン色 */
.sync-description-item:nth-child(1) .sync-description-icon {
    background-color: #4CAF50; /* 追加ボタン */
}

.sync-description-item:nth-child(2) .sync-description-icon {
    background-color: #FF9800; /* 複製ボタン */
}

.sync-description-item:nth-child(3) .sync-description-icon {
    background-color: #673AB7; /* 入れ替えボタン */
}

.sync-description-item:nth-child(4) .sync-description-icon {
    background-color: #2196F3; /* RとL入れ替えボタン */
}

.sync-description-item:nth-child(5) .sync-description-icon {
    background-color: #f44336; /* 削除ボタン */
}

.sync-description-text {
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}