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

body {
    font-family: "Noto Serif JP", "Hachi Maru Pop", serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    line-height: 1.8;
}

/* キャンバスコンテナ */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ヘッダー */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    z-index: 1000;
    background: transparent;
}

/* ナビゲーションメニュー（デスクトップ） */
.nav-menu {
    display: none;
    justify-content: center;
}

.menu-list {
    display: flex;
    list-style: none;
    gap: 30px;
}

.menu-item a {
    text-decoration: none;
    color: #ff6b9d;
    font-size: 20px;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: block;
    border: 2px solid transparent;
    font-family: "Hachi Maru Pop", cursive;
}

.menu-item a:hover {
    background: #feca57;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(254, 202, 87, 0.4);
    border-color: #ff6b9d;
}

/* モバイルメニューボタン */
.mobile-menu-btn {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background: #ff6b9d;
    margin: 5px auto;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-btn:hover {
    background: #feca57;
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

/* モバイルメニュー */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: linear-gradient(135deg, #feca57 0%, #feca57 100%);
    padding: 80px 30px;
    transition: right 0.3s ease;
    z-index: 999;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-list {
    list-style: none;
}

.mobile-menu-item {
    margin-bottom: 20px;
    animation: slideInRight 0.5s ease forwards;
    opacity: 0;
}

.mobile-menu.active .mobile-menu-item {
    opacity: 1;
}

.mobile-menu-item:nth-child(1) {
    animation-delay: 0.1s;
}
.mobile-menu-item:nth-child(2) {
    animation-delay: 0.2s;
}
.mobile-menu-item:nth-child(3) {
    animation-delay: 0.3s;
}
.mobile-menu-item:nth-child(4) {
    animation-delay: 0.4s;
}

.mobile-menu-item a {
    color: #ff6b9d;
    text-decoration: none;
    font-size: 22px;
    display: block;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    transition: all 0.3s ease;
    text-align: center;
    font-family: "Hachi Maru Pop", cursive;
}

.mobile-menu-item a:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-10px);
}

/* 小説コンテンツ */
.novel-container {
    position: relative;
    z-index: 100;
    padding: 100px 20px 50px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.novel-content {
    width: 100%;
    max-width: 800px;
    /* background: rgba(255, 255, 255, 0.3); */
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    animation: fadeInUp 0.8s ease;
}

.novel-header {
    text-align: center;
    padding: 40px 20px;
    border-bottom: 1px solid rgba(255, 107, 157, 0.1);
}

.novel-title {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #ff6b9d;
    font-weight: 600;
    margin-bottom: 20px;
    font-family: "Hachi Maru Pop", cursive;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.title-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.decoration-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #feca57, transparent);
}

.decoration-dot {
    width: 10px;
    height: 10px;
    background: #ff6b9d;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* 小説本文 */
.novel-body {
    padding: 40px;
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: #333;
}

.novel-body p {
    margin-bottom: 1.5em;
    text-indent: 1em;
    line-height: 2;
    text-align: justify;
}

/* 特別なスタイル */
.opening {
    text-indent: 0 !important;
    text-align: center;
    font-size: 1.1em;
    color: #ff6b9d;
    font-weight: 500;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.05), rgba(255, 255, 255, 0.5));
    border-radius: 10px;
    margin-bottom: 2em !important;
}

.scene-break {
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px dotted rgba(255, 107, 157, 0.2);
}

.thought {
    text-indent: 0 !important;
    text-align: center;
    font-style: italic;
    color: #888;
    margin: 1.5em 0;
}

.dream-start {
    text-indent: 0 !important;
    text-align: center;
    font-size: 1.1em;
    color: #87ceeb;
    padding: 15px;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1), rgba(255, 255, 255, 0.5));
    border-radius: 10px;
    margin: 2em 0 !important;
}

.exclamation {
    text-indent: 0 !important;
    text-align: center;
    font-size: 1.2em;
    color: #feca57;
    font-weight: bold;
    margin: 1em 0;
}

.dialogue {
    text-indent: 0 !important;
    padding-left: 2em;
    color: #666;
    font-style: italic;
    border-left: 3px solid #ffd700;
    margin: 1em 0;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05), transparent);
}

.dialogue.mama {
    border-left-color: #ff6b9d;
    background: linear-gradient(90deg, rgba(255, 107, 157, 0.05), transparent);
}

.journey {
    text-align: center;
    font-size: 1.1em;
    color: #4169e1;
    font-weight: 500;
    margin: 2em 0;
    text-indent: 0 !important;
}

.magical {
    text-indent: 0 !important;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.1),
        rgba(135, 206, 235, 0.1),
        rgba(255, 192, 203, 0.1)
    );
    border-radius: 15px;
    line-height: 2.5;
    color: #555;
    font-style: italic;
}

.realization {
    font-style: italic;
    color: #666;
    padding: 15px;
    background: linear-gradient(135deg, rgba(255, 245, 238, 0.8), rgba(255, 255, 255, 0.5));
    border-radius: 10px;
    text-indent: 1em !important;
}

.promise {
    text-indent: 0 !important;
    text-align: center;
    color: #ff6b9d;
    font-weight: 500;
    margin-top: 2em;
}

.ending {
    text-align: center;
    font-size: 1.1em;
    color: #87ceeb;
    margin-top: 3em !important;
    padding: 20px;
    background: linear-gradient(135deg, rgba(135, 206, 235, 0.1), rgba(255, 255, 255, 0.8));
    border-radius: 15px;
    text-indent: 0 !important;
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(135, 206, 235, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(135, 206, 235, 0.4);
    }
}

/* フッター */
.novel-footer {
    padding: 30px;
    text-align: center;
    border-top: 1px solid rgba(255, 107, 157, 0.1);
}

.back-button {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #ff6b9d, #ff7bde);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: "Hachi Maru Pop", cursive;
    box-shadow: 0 5px 15px rgba(255, 107, 157, 0.3);
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.5);
}

/* スクロールバーのカスタマイズ */
.novel-body::-webkit-scrollbar {
    width: 8px;
}

.novel-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.novel-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ff6b9d, #feca57);
    border-radius: 10px;
}

/* アニメーション */
@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

/* レスポンシブデザイン */
@media (min-width: 768px) {
    .nav-menu {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }

    .mobile-menu {
        display: none;
    }
    
    .novel-body {
        padding: 50px 60px;
    }
}

/* タブレット対応 */
@media (max-width: 768px) {
    .novel-body {
        padding: 30px 35px;
    }
    
    .mobile-menu {
        width: 320px;
    }

    .mobile-menu-item a {
        font-size: 20px;
    }
}

/* スマートフォン対応 */
@media (max-width: 480px) {
    .header {
        padding: 15px;
    }

    .mobile-menu-btn {
        top: 15px;
        right: 15px;
        width: 35px;
        height: 35px;
    }

    .mobile-menu {
        width: 250px;
        padding: 70px 20px;
    }

    .mobile-menu-item a {
        font-size: 18px;
        padding: 12px;
    }

    .novel-container {
        padding: 80px 10px 30px;
    }
    
    .novel-content {
        border-radius: 15px;
    }
    
    .novel-header {
        padding: 30px 15px;
    }
    
    .novel-title {
        font-size: 1.8rem;
    }
    
    .novel-body {
        padding: 25px 20px;
        font-size: 0.95rem;
    }
    
    .novel-body p {
        text-align: left;
        line-height: 1.8;
    }
    
    .magical {
        line-height: 2.2;
        padding: 15px;
    }
    
    .back-button {
        padding: 10px 25px;
        font-size: 0.95rem;
    }
}