/* 
  全体設定 
  黒背景、目に痛くない灰色文字 
*/
:root {
    --bg-color: #050505;
    /* 真っ黒より少しだけ浮かせて目に優しく */
    --text-color: #cccccc;
    /* 目に痛くない灰色 */
    --text-gray: #555555;
    /* 目に痛くない灰色 */
    --accent-blue: #1a2b4c;
    /* 紺色 */
    --accent-blue-hover: #2a4173;
    --accent-red: #800000;
    /* 臙脂色 */
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Hiragino Mincho ProN', 'Yu Mincho', serif;
    /* 小説に合う明朝体 */
    overflow: hidden;
    /* ページ全体はスクロールさせない */
}

/* ファーストビュー用コンテナ */
#first-view-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    /* 提案②：ビネット効果（四隅の暗がり） */
    background: radial-gradient(circle at center, transparent 20%, rgba(0, 0, 0, 0.95) 100%);
}

/* 提案②：ノイズテクスチャ */
#first-view-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
}

/* 縦書きあらすじコンテナ */
#scene-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* テキスト自体はクリック不可 */
    z-index: 2;
    /* ノイズより前面に */
}

/* 縦書きの文 */
.vertical-sentence {
    color: var(--text-gray);
    position: absolute;
    writing-mode: vertical-rl;
    text-orientation: upright;
    opacity: 0;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    /* 提案③：色と影のトランジションを追加 */
    transition: opacity 1.5s ease-in-out, filter 2.5s ease-in-out, transform 2.5s ease-in-out, color 2s ease-in-out, text-shadow 2s ease-in-out;
}

/* 表示時 */
.vertical-sentence.visible {
    opacity: 1;
}

/* 溶けるように消えるアニメーション用（提案③：赤く滲む） */
.vertical-sentence.melting {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(30px);
    color: var(--accent-red);
    text-shadow: 0 0 15px var(--accent-red);
}

/* 最後のテキストコンテナ */
#final-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 2s ease-in-out;
    /* ふわっと長めに出現させる */
    pointer-events: none;
    z-index: 3;
}

/* 最後のテキスト */
.final-text {
    font-size: 2.5rem;
    letter-spacing: 0.2em;
    margin: 0;
}

/* 表示切り替え用クラス */
.hidden {
    display: none !important;
}

.fade-in {
    opacity: 1 !important;
}

/* クリック用オーバーレイ */
#click-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

/* モーダルウィンドウ */
#modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    /* コンテンツが長い場合上から表示 */
    overflow-y: auto;
    /* モーダル内が長い場合に縦スクロールを許可 */
    padding: 3rem 0;
    /* 上下に余白を持たせる */
    box-sizing: border-box;
    z-index: 100;
    opacity: 0;
    animation: fadeInModal 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 提案④：下からスッと冷たく立ち上がるアニメーション */
@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.modal-content {
    background-color: #080808;
    border: 1px solid var(--accent-blue);
    padding: 2rem;
    position: relative;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 0 40px rgba(26, 43, 76, 0.5);
    /* 紺色の発光に戻す */
    margin: auto;
    /* display:flexの中央寄せを維持しつつスクロール対応 */
}

/* 作品リンクのデザイン */
.link-container {
    text-align: center;
    margin: 1.5rem 0;
}

.novel-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--accent-blue);
    padding-bottom: 2px;
    transition: color 0.3s, border-color 0.3s;
}

.novel-link:hover {
    color: #fff;
    border-color: var(--accent-blue-hover);
}

.modal-body {
    line-height: 2;
}

.modal-body h2 {
    font-size: 1.5rem;
    margin-top: 0;
    border-bottom: 1px solid var(--accent-red);
    padding-bottom: 0.5rem;
}

.label {
    display: inline-block;
    padding: 0.1em 0.5em;
    font-size: 0.9em;
    margin-right: 0.5em;
    color: #fff;
}

.accent-blue {
    background-color: var(--accent-blue);
}

.accent-red {
    background-color: var(--accent-red);
}

/* スマホ向け調整 */
@media screen and (max-width: 768px) {
    .vertical-sentence {
        font-size: 1rem;
        /* スマホで収まるようサイズダウン */
    }

    .final-text {
        font-size: 1.5rem;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .modal-body h2 {
        font-size: 1.2rem;
    }
}