/* 全体の設定 */
body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    background: #eef5e1;
}

/* コンテナの設定 */
.container {
    width: 90%;
    max-width: 1200px;
    background: #f0f8e2;
    padding: 20px;
    border: 2px solid #99cc66;
}

/* ヘッダー */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 2px solid #99cc66;
    background: #eef5e1;
    position: relative;
    width: 100%;
}

.header-left,
.header-center,
.header-right {
    display: flex;
    align-items: center;
}

.header-center {
    flex-grow: 1;
    justify-content: center;
}

.icon {
    width: 25px;
    height: 25px;
    margin: 0 5px;
}

/* メインコンテンツ */
.main-content {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

/* 左側のテキストエリア */
.main-left {
    width: 40%;
    display: flex;
    justify-content: center;
}

.input-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

textarea,
input[type="text"] {
    width: 100%;
    font-size: 18px;
    padding: 10px;
    border: 2px solid #99cc66;
    background: #fff;
    resize: none;
    box-sizing: border-box;
}

label {
    font-weight: bold;
    margin-top: 10px;
}

#titleCount,
#authorCount,
#charCount {
    text-align: right;
    font-size: 14px;
    color: #666;
}

/* 右側（ボタン、プレビュー） */
.main-right {
    width: 55%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ボタン配置 */
.button-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

button {
    width: 180px;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #66a366;
    background: #99cc66;
    cursor: pointer;
}

/* フォント設定用モーダル */
#fontModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.modal-content {
    text-align: center;
}

#fontList {
    list-style: none;
    padding: 0;
}

#fontList li {
    padding: 10px;
    margin: 5px;
    cursor: pointer;
    font-size: 20px;
    border: 1px solid #ccc;
    border-radius: 5px;
    transition: background 0.3s;
}

#fontList li:hover {
    background: #f0f0f0;
}


/* canvas と video */
canvas,
video {
    width: 100%;
    max-width: 600px;
    margin-top: 10px;
    background: #fff;
}

/* フッター */
footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border: 2px solid #333;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
}

.modal-content ul {
    list-style: none;
    padding: 0;
}

.modal-content li {
    display: flex;
    align-items: center;
    margin: 10px 0;
}

.play-button {
    width: 50px;
    height: 50px;
    cursor: pointer;
    margin-left: 10px;
}

/* フォントカラー選択モーダル用 */
.font-color-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.font-color-modal.hidden {
    display: none;
}

.font-color-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.color-samples div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.color-samples div span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: transform 0.2s;
}

.color-samples div span:hover {
    transform: scale(1.2);
}

.font-color-buttons {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

.bg-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border: 2px solid #333;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.bg-modal-content {
    max-width: 500px;
    padding: 10px;
}

.bg-modal-close {
    float: right;
    font-size: 24px;
    cursor: pointer;
}

.bg-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin: 5px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
}

.bg-thumbnail:hover {
    border: 2px solid blue;
}

/* 動画サイズ設定モーダル用 */
.movie-size-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.movie-size-modal.hidden {
    display: none;
}

.movie-size-modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#movieSizeList {
    list-style: none;
    padding: 0;
    margin-top: 10px;
}

#movieSizeList li {
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

#movieSizeList li:hover {
    background: #f0f0f0;
}

/* 速度設定モーダル */
.speed-setting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.speed-setting-modal.hidden {
    display: none;
}

.speed-setting-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* OP設定モーダル */
.op-setting-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.op-setting-modal.hidden {
    display: none;
}

.op-setting-content {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    width: 420px;
    max-width: 95%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.bgm-option-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.bgm-option-row label {
    flex: 1;
}

.op-play-button {
    cursor: pointer;
}