/* 1. ページ全体の基本設定 */
body,
html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", "HGS Mincho E", serif;
}

/* 2. 深海背景 */
.ocean {
    height: 100vh;
    width: 100%;
    background: linear-gradient(to top, #02111b 0%, #064e58 50%, #40e0d0 100%);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- ハンバーガーメニュー --- */
.menu-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 1px;
    background-color: white;
    margin: 8px 0;
    transition: 0.4s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 6px);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-6px, -6px);
}

/* --- メニューオーバーレイ --- */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 17, 27, 0.95);
    z-index: 900;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    backdrop-filter: blur(5px);
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-list {
    list-style: none;
    padding: 0;
    text-align: center;
}

.nav-list li {
    font-size: 2rem;
    color: white;
    margin: 30px 0;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.3s;
    letter-spacing: 0.2em;
    font-family: sans-serif;
}

.nav-list li:hover {
    opacity: 1;
    color: #40e0d0;
    transform: scale(1.1);
}

/* --- ガラスパネル（共通） --- */
.glass-panel {
    z-index: 10;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 40px;
    width: 85%;
    max-width: 600px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    color: #e0fbfd;
    max-height: 85vh;
    overflow-y: auto;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* --- Topページ --- */
.home-header {
    text-align: center;
    margin-bottom: 60px;
    border-bottom: 1px solid rgba(64, 224, 208, 0.3);
    padding-bottom: 30px;
}

.site-concept {
    font-size: 0.8rem;
    letter-spacing: 0.4em;
    opacity: 0.7;
    margin-bottom: 15px;
    font-family: sans-serif;
}

.main-title {
    font-size: 3rem;
    letter-spacing: 0.15em;
    font-weight: normal;
    text-shadow: 0 0 20px rgba(64, 224, 208, 0.4);
    margin: 0;
}

.author-name {
    font-size: 0.9rem;
    text-align: right;
    opacity: 0.6;
    font-style: italic;
    margin-top: 15px;
}

.latest-info {
    text-align: center;
    margin-bottom: 50px;
    opacity: 0.8;
    font-size: 0.9rem;
}

.info-label {
    color: #40e0d0;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    margin-bottom: 5px;
}

.enter-btn {
    display: block;
    margin: 0 auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 15px 40px;
    font-size: 1rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: 0.4s;
    font-family: serif;
}

.enter-btn:hover {
    background: rgba(64, 224, 208, 0.2);
    border-color: #40e0d0;
    letter-spacing: 0.3em;
}

/* --- Novelsページ --- */
.section-title {
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 40px;
    font-weight: normal;
    letter-spacing: 0.2em;
    opacity: 0.9;
}

.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-family: sans-serif;
    font-size: 0.8rem;
    transition: 0.3s;
}

.tab-btn:hover,
.tab-btn.active {
    background: rgba(64, 224, 208, 0.2);
    border-color: #40e0d0;
    color: white;
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.novel-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.novel-card:hover {
    transform: translateY(-5px);
    border-color: #40e0d0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    background: rgba(64, 224, 208, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.status-badge {
    font-size: 0.6rem;
    padding: 3px 8px;
    border: 1px solid #40e0d0;
    color: #40e0d0;
    border-radius: 4px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: sans-serif;
}

.status-badge.short {
    border-color: #00b7ff;
    color: #00b7ff;
}

.tag-area {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 60%;
}

.mini-tag {
    font-size: 0.65rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    padding: 2px 6px;
    border-radius: 10px;
    font-family: sans-serif;
}

.card-title {
    font-size: 1.3rem;
    margin: 0 0 8px 0;
    font-weight: normal;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 0 5px rgba(64, 224, 208, 0.3);
}

.chara-info {
    font-size: 0.8rem;
    color: #e0fbfd;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.chara-info .label {
    color: #40e0d0;
    font-size: 0.7rem;
    margin-right: 5px;
    font-family: sans-serif;
    opacity: 0.8;
    text-transform: uppercase;
}

.card-desc {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: auto;
}

.novel-card:hover .read-more {
    color: #40e0d0;
    transform: translateX(5px);
    transition: 0.3s;
}

/* --- Dream誘導ボタン（新規追加分） --- */
.dream-link-area {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(64, 224, 208, 0.05);
    border-radius: 8px;
    border: 1px dashed rgba(64, 224, 208, 0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.dream-msg {
    font-size: 0.8rem;
    opacity: 0.8;
    margin: 0;
    font-family: sans-serif;
    letter-spacing: 0.05em;
}

.dream-nav-btn {
    background: rgba(64, 224, 208, 0.1);
    border: 1px solid #40e0d0;
    color: #40e0d0;
    padding: 8px 25px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: sans-serif;
    letter-spacing: 0.1em;
}

.dream-nav-btn:hover {
    background: #40e0d0;
    color: #02111b;
    box-shadow: 0 0 15px rgba(64, 224, 208, 0.6);
    transform: translateY(-2px);
}

/* --- Dream設定ページ --- */
.dream-form {
    text-align: center;
    margin-top: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #40e0d0;
    letter-spacing: 0.1em;
}

.input-group input,
.input-group select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    transition: 0.3s;
    text-align: center;
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.input-group select option {
    background: #02111b;
    color: white;
}

.input-group input:focus,
.input-group select:focus {
    border-color: #40e0d0;
    background: rgba(255, 255, 255, 0.2);
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    margin-top: 30px;
}

.menu-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 25px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}

.menu-btn:hover {
    background: rgba(64, 224, 208, 0.4);
    transform: translateY(-2px);
}

.menu-btn.delete {
    background: transparent;
    opacity: 0.7;
}

.menu-btn.delete:hover {
    background: rgba(255, 100, 100, 0.2);
    opacity: 1;
}

.preview-text {
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    line-height: 1.6;
}

/* --- Readerページ --- */
.reader-mode {
    background: rgba(0, 8, 15, 0.85);
    text-align: left;
}

.story-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
}

.story-header h2 {
    font-size: 1.1rem;
    margin: 0;
    font-weight: normal;
}

.back-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 15px;
    cursor: pointer;
    font-size: 0.8rem;
    border-radius: 20px;
    transition: 0.3s;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.story-body {
    line-height: 2.2;
    font-size: 1rem;
    letter-spacing: 0.05em;
}

.end-mark {
    text-align: center;
    opacity: 0.5;
    margin-top: 50px;
    letter-spacing: 0.5em;
}

/* --- 泡アニメーション --- */
.bubble {
    position: absolute;
    bottom: -100px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.3);
    pointer-events: none;
    animation: rise 10s infinite ease-in;
    z-index: 1;
}

@keyframes rise {
    0% {
        bottom: -100px;
        transform: translateX(0);
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    50% {
        transform: translateX(30px);
    }

    100% {
        bottom: 120vh;
        transform: translateX(-30px);
        opacity: 0;
    }
}

.bubble:nth-child(1) {
    left: 10%;
    width: 40px;
    height: 40px;
    animation-duration: 8s;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    left: 20%;
    width: 20px;
    height: 20px;
    animation-duration: 12s;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    left: 35%;
    width: 25px;
    height: 25px;
    animation-duration: 10s;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    left: 50%;
    width: 30px;
    height: 30px;
    animation-duration: 15s;
    animation-delay: 1s;
}

.bubble:nth-child(5) {
    left: 65%;
    width: 25px;
    height: 25px;
    animation-duration: 11s;
    animation-delay: 6s;
}

.bubble:nth-child(6) {
    left: 80%;
    width: 30px;
    height: 30px;
    animation-duration: 18s;
    animation-delay: 3s;
}

.bubble:nth-child(7) {
    left: 90%;
    width: 35px;
    height: 35px;
    animation-duration: 14s;
    animation-delay: 7s;
}

.bubble:nth-child(8) {
    left: 25%;
    width: 10px;
    height: 10px;
    animation-duration: 9s;
    animation-delay: 2s;
    opacity: 0.5;
}

.bubble:nth-child(9) {
    left: 70%;
    width: 15px;
    height: 15px;
    animation-duration: 13s;
    animation-delay: 5s;
    opacity: 0.5;
}

/* --- 目次アコーディオン --- */
.chapter-toggle-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(64, 224, 208, 0.8);
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8rem;
    margin-top: 10px;
    transition: 0.3s;
    font-family: sans-serif;
}

.chapter-toggle-btn:hover {
    background: rgba(64, 224, 208, 0.1);
    color: #40e0d0;
}

.chapter-list {
    margin-top: 10px;
    padding-left: 10px;
    border-left: 2px solid rgba(64, 224, 208, 0.3);
    /* 左側に線をつける */
    animation: slideDown 0.3s ease;
    /* ふわっと開くアニメーション */
}

.chapter-list p {
    font-size: 0.9rem;
    color: #e0fbfd;
    margin: 8px 0;
    cursor: pointer;
    opacity: 0.7;
    transition: 0.2s;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 5px;
}

.chapter-list p:hover {
    opacity: 1;
    color: #40e0d0;
    padding-left: 5px;
    /* ホバーで少し右に動く */
}

/* 開くときのアニメーション定義 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

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

/* --- ▼ 追加分：R-18用デザイン --- */
.status-badge.r18 {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.mini-tag.red {
    background: rgba(255, 0, 0, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 0, 0.4);
}

/* --- ▼ 追加分：文字サイズ変更ボタン --- */
.font-size-changer {
    text-align: right;
    margin-bottom: 20px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.font-size-changer button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    margin-left: 5px;
    border-radius: 4px;
    cursor: pointer;
}

.font-size-changer button:hover {
    background: rgba(64, 224, 208, 0.3);
    border-color: #40e0d0;
}

/* --- ▼ 追加分：いいねボタン（WEB拍手） --- */
.clap-area {
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 30px;
}

.clap-btn {
    background: rgba(255, 105, 180, 0.1);
    border: 1px solid #ff69b4;
    color: #ff69b4;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
}

.clap-btn:hover {
    background: #ff69b4;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.6);
}

.clap-btn .heart {
    margin-right: 5px;
}

.clap-msg {
    color: #ff69b4;
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0;
    transition: 0.5s;
}

.clap-msg.show {
    opacity: 1;
    transform: translateY(-5px);
}