/* ==============================
   海のアニメーション全体
============================== */
.ocean {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* 波アニメーション */
.wave {
    position: absolute;
    bottom: 0;
    width: 200%;
    height: 60px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="60"><path d="M0 30 Q150 0 300 30 T600 30 T900 30 T1200 30 V60 H0 Z" fill="%23aee0f4"/></svg>') repeat-x;
    background-size: 1200px 60px;
    animation: waveMove 12s linear infinite;
    opacity: 0.7;
}

.wave2 {
    bottom: 10px;
    animation-duration: 20s;
    opacity: 0.5;
}

@keyframes waveMove {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-600px);
    }
}

/* 泡アニメーション */
.bubbles {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-around;
}

.bubbles span {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: bubbleRise calc(10s / var(--i)) linear infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translateY(-200px) scale(0.6);
        opacity: 0;
    }
}

/* 魚アニメーション */
.fish {
    position: absolute;
    bottom: 60px;
    left: -10%;
    width: 80px;
    animation: swim 18s ease-in-out infinite;
    opacity: 0.9;
}

@keyframes swim {
    0% {
        transform: translateX(-10%) rotate(0deg);
    }

    50% {
        transform: translateX(110%) rotate(5deg);
    }

    100% {
        transform: translateX(-10%) rotate(0deg);
    }
}

/* --- フェード制御 --- */
.ocean {
    opacity: 0;
    transition: opacity 1.8s ease;
}

.ocean.visible {
    opacity: 1;
}

.ocean.fade-out {
    opacity: 0;
}


.library-content h2 {
    font-family: "fot-tsukuardgothic-std", sans-serif;
    font-style: normal;
    background: none;
    color: #0E3C7B;
    font-size: 24px;
    text-align: center;
    font-weight: 600;
    margin: 40px auto 20px;
    display: block;
}

/* --- 初期状態 --- */
.wave-title {
    display: inline-block;
    overflow: hidden;
    visibility: hidden;
    /* 初期は非表示 */
}

.wave-title.ready {
    visibility: visible;
    /* JSで加工後に表示 */
}

.wave-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 表示時 */
.wave-title.visible span {
    animation: floatUp 0.6s ease forwards;
}

@keyframes floatUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.library-content img {
    border-radius: 16px;
    margin: 30px auto;
    max-width: 100%;
}

/* 画像フェードイン */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.library-content {
    padding: 0 20px;
}

.library-content p {
    text-align: justify;
    line-height: 2;
    font-size: 15px;
}

.library-content .flex-wrap {
    display: flex;
    justify-content: space-between;
    flex-direction: column;
}


.library-content .flex-wrap img {
    max-width: 300px;
}

.library-content section {
    padding: 0;
}

#library .wave-title {
    display: inline-block;
    text-align: center;
}

/* 改行専用 span */
#library .wave-title .wave-break {
    display: block;
    width: 100%;
    height: 0;
}

/* 文字 */
#library .wave-title span {
    display: inline-block;
}

.margintop0 {
    margin-top: 0 !important;
}