body {
    background-color: #1a1a1a;
    color: #fff;
    font-family: 'Helvetica Neue', 'Arial', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#game-container {
    width: 800px;
    height: 600px;
    background-color: #000;
    border: 2px solid #444;
    position: relative;
    overflow: hidden;
}

.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    background: #000 url('https://www.transparenttextures.com/patterns/stardust.png'); /* Simple background texture */
}

.screen.active {
    display: flex;
}

/* タイトル画面 */
#title-screen h1 {
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px #fff, 0 0 20px #0f0;
}

.menu button, .screen button {
    background-color: #222;
    border: 1px solid #555;
    color: #fff;
    padding: 15px 30px;
    margin: 10px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.menu button:hover, .screen button:hover {
    background-color: #333;
    box-shadow: 0 0 15px #0f0;
}

/* ゲーム画面 */
#game-screen {
    justify-content: flex-end;
}

#message-box {
    width: 95%;
    height: 180px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #555;
    margin-bottom: 20px;
    padding: 20px;
    box-sizing: border-box;
    cursor: pointer;
}

#character-name {
    font-weight: bold;
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #0f0;
}

#message-text {
    font-size: 18px;
    margin: 0;
    line-height: 1.6;
    height: 90px;
    overflow-y: auto;
}

/* タイプライターカーソル */
#message-text::after {
    content: '▋';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

#choices-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 30px;
}

#choices-box button {
    width: 80%;
    margin-bottom: 10px;
}

/* 設定・ロード画面 */
#settings-screen h2, #load-screen h2 {
    font-size: 32px;
    margin-bottom: 30px;
}

.setting-item {
    font-size: 20px;
    margin-bottom: 20px;
}

#tts-toggle {
    width: 20px;
    height: 20px;
}

#save-slots .slot {
    background-color: #2a2a2a;
    border: 1px solid #666;
    padding: 20px;
    margin-bottom: 10px;
    width: 400px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#save-slots .slot:hover {
    background-color: #444;
}

#save-slots .slot.empty {
    color: #888;
}

/* ... 既存のスタイルはそのまま ... */

/* 【追加】ゲーム内メニュー */
#ingame-menu {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}
#ingame-menu button {
    padding: 8px 15px;
    font-size: 14px;
    background-color: rgba(50, 50, 50, 0.7);
}

/* メッセージボックスの調整 */
#message-box {
    position: absolute;
    bottom: 20px;
    left: 2.5%;
}

/* 選択肢ボックスの調整 */
#choices-box {
    position: absolute;
    bottom: 220px; /* メッセージボックスの上 */
    left: 50%;
    transform: translateX(-50%);
}

/* セーブ・ロード画面の共通スタイル */
.slot-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
}
.slot {
    background-color: #2a2a2a;
    border: 1px solid #666;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    cursor: pointer;
    transition: background-color 0.2s;
    box-sizing: border-box;
}
.slot:hover {
    background-color: #444;
}
.slot.empty {
    color: #888;
}

/* 【追加】ログ画面のスタイル */
#log-screen h2 {
    margin-top: 20px;
}
#log-content {
    width: 90%;
    height: 75%;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #555;
    padding: 15px;
    overflow-y: auto;
    margin-bottom: 15px;
    text-align: left;
}
.log-entry {
    margin-bottom: 1em;
}
.log-char {
    font-weight: bold;
    color: #0f0;
    margin-bottom: 0.2em;
}
.log-line {
    margin-left: 1em;
}

/* ... 既存のスタイル ... */

/* 【更新】セーブ・ロード画面のコンテナ */
.slot-container {
    width: 90%;
    height: 420px; /* 高さを固定 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    overflow-y: auto; /* スクロールバーを有効化 */
    padding: 10px;
    border: 1px solid #444;
    background-color: rgba(0,0,0,0.2);
}
/* ... 既存のスタイルはそのまま ... */

/* 【追加】エンディングリスト画面のスタイル */
#achievement-rate {
    font-size: 20px;
    margin-bottom: 15px;
    color: #0f0; /* 目立たせる */
}

.ending-entry {
    background-color: #2a2a2a;
    border: 1px solid #666;
    padding: 15px 20px;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    text-align: left;
}

.ending-entry.unseen {
    color: #777;
}

.ending-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 5px 0;
}

.ending-desc {
    font-size: 14px;
    margin: 0;
    line-height: 1.5;
}

/* ... 既存のスタイルはそのまま ... */
/* 【追加】モーダル（確認ダイアログ）のスタイル */
.modal-overlay {
    display: none; /* Hidden by default */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex; /* Show it */
}

.modal-content {
    background-color: #1a1a1a;
    padding: 30px 40px;
    border: 1px solid #666;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-content p {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 25px;
}
.modal-content p small {
    font-size: 14px;
    color: #aaa;
}

.modal-buttons button {
    background-color: #222;
    border: 1px solid #555;
    color: #fff;
    padding: 10px 25px;
    margin: 0 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}
.modal-buttons button:hover {
    background-color: #333;
    box-shadow: 0 0 15px #0f0;
}
#confirm-yes:hover {
    box-shadow: 0 0 15px #f00; /* はいボタンは赤く光らせる */
}

/* ... 既存のスタイル ... */
/* ゲーム画面 */
#game-screen {
    justify-content: flex-end;
    align-items: center;
}

/* 【変更】メイン(日本語)メッセージボックス */
#main-message-box {
    width: 95%;
    height: 180px;
    background-color: rgba(0, 0, 0, 0.8);
    border: 2px solid #555;
    margin-bottom: 20px;
    padding: 20px;
    box-sizing: border-box;
    cursor: pointer;
    position: relative;
}

/* 【追加】英語メッセージボックス */
#secondary-message-box {
    width: 95%;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    border-bottom: none;
    padding: 15px;
    box-sizing: border-box;
    color: #ccc;
}

#character-name {
    font-weight: bold;
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #0f0;
}

#main-message-text, #secondary-message-text {
    font-size: 18px;
    margin: 0;
    line-height: 1.6;
    height: 90%;
    overflow-y: auto;
}
#secondary-message-text {
    font-size: 16px;
    height: 100%;
}

/* 【変更】選択肢ボックスの位置 */
#choices-box {
    position: absolute;
    bottom: 340px; /* メッセージボックスの上 */
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#choices-box button {
    width: 80%;
}

/* 【変更】設定画面のラジオボタン */
.tts-options {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
}
.tts-options label {
    margin-right: 15px;
}
/* ... モーダルなどの既存スタイルはそのまま ... */
/* ... 既存のスタイル ... */

/* 【追加】オートプレイボタンがアクティブな時のスタイル */
#ingame-menu button.autoplay-active {
    color: #0ff;
    box-shadow: 0 0 8px #0ff;
    border-color: #0ff;
}

/* ... その他の既存スタイルはそのまま ... */

