/* Color Palette and Base Setup */
:root {
    --bg-color: #1a1c21;
    /* Dark, chic background */
    --text-color: #e4e6eb;
    /* Soft off-white for readability without glare */
    --accent-color: #8b9bb4;
    --link-bg: #2a2e35;
    --link-hover: #3d434c;
    --font-family: 'Shippori Mincho', 'Noto Serif JP', serif;
    /* Elegant Japanese serif */
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.novel-container {
    max-width: 760px;
    margin: 0 auto;
    padding: 80px 20px;
    box-sizing: border-box;
    position: relative;
    z-index: 10;
    /* Ensure it stays above particles */
}

/* Header */
.novel-header {
    text-align: center;
    margin-bottom: 60px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 40px;
}

.novel-title {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: #ffffff;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Body Content */
.novel-body {
    font-size: 1.05rem;
    line-height: 1.8;
    /* Wide line height for easy reading */
    letter-spacing: 0.06em;
    white-space: pre-wrap;
    /* 改行やスペースをそのまま反映する指定 */
    word-wrap: break-word;
    opacity: 0.85;
    /* Slightly mute the text for less eye strain */
    padding: 0 10px;
    color: #d1d5db;
}


/* Responsive adjustments */
@media (max-width: 600px) {
    .novel-container {
        padding: 40px 15px;
    }

    .novel-header {
        margin-bottom: 40px;
        padding-bottom: 25px;
    }

    .novel-title {
        font-size: 1.6rem;
    }

    .novel-body {
        font-size: 1rem;
        line-height: 2.0;
    }

    .novel-footer {
        margin-top: 60px;
        padding-top: 40px;
    }

    #back-to-top {
        bottom: 15px;
        right: 15px;
        width: 30px;
        height: 30px;
    }
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#back-to-top.show {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

/* Snow Particles */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 1;
    /* Below the main container */
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -20px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    animation: drift linear infinite;
}

@keyframes drift {
    0% {
        transform: translateY(-20px) translateX(0);
    }

    100% {
        transform: translateY(110vh) translateX(30px);
    }
}