* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Yu Gothic', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    height: -webkit-fill-available;
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 0;
    background-color: #000;
}

/* コンテナ */
#app-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 100vh;
    overflow: hidden;
}

/* タイトル画面 */
.title-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.title-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.title-text {
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    letter-spacing: 4px;
    text-align: center;
}

/* 漫画ページ */
.manga-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-in-out;
    overflow-y: auto;
    overflow-x: hidden;
}

.manga-page.show {
    opacity: 1;
    pointer-events: auto;
}

.manga-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    max-width: 100%;
}

/* 常時表示クローズボタン */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 30;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
    user-select: none;
}

.close-btn:hover {
    color: #fff;
}

/* エンド画面 */
.replay-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 40vh;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in-out;
}

.replay-screen.show {
    opacity: 1;
    pointer-events: auto;
}

.replay-button {
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: opacity 0.2s ease;
}

.replay-button:hover {
    opacity: 0.7;
}

/* グローバルミュートボタン */
.mute-btn {
    position: absolute;
    top: 30px;
    left: 30px;
    z-index: 100;
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mute-btn svg {
    fill: #ffffff;
    opacity: 0.5;
    width: 32px;
    height: 32px;
    transition: opacity 0.2s ease, transform 0.3s ease;
}

.mute-btn:hover svg {
    opacity: 1;
    transform: scale(1.1);
}

/* レスポンシブ対応 */

/* モバイル */
@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding-top: 10vh;
    }

    #app-container {
        height: 90vh;
    }

    .title-screen {
        align-items: flex-start;
        padding-top: 35vh;
    }

    .title-text {
        font-size: 36px;
    }

    .replay-button {
        font-size: 20px;
    }
}

/* 縦長画面対応（縦横比を考慮） */
@media (max-aspect-ratio: 3/4) {
    .manga-page {
        align-items: flex-start;
    }

    .manga-image {
        min-height: 100vh;
        width: auto;
        max-width: 100vw;
    }
}