/* ═══════════════════════════════════════════
   第64話「渡し場まで」── ヴィジュアルノベル版
   アクリル水彩挿絵付きスタイルシート
   ═══════════════════════════════════════════ */

:root {
    --parchment-bg: #f5e6c8;
    --parchment-bg-dark: #e8d5a8;
    --ink-primary: #3a2a1a;
    --ink-secondary: #5a4632;
    --ink-light: #7a6652;
    --ink-faint: #9a8672;
    --accent-red: #8b3a2a;
    --accent-gold: #b8963a;
    --border-ornate: #8a7656;
    --shadow-warm: rgba(58, 42, 26, 0.15);
    --shadow-deep: rgba(58, 42, 26, 0.25);

    --font-narration: 'Noto Serif JP', 'Yu Mincho', serif;
    --font-sephira: 'Shippori Mincho', 'Yu Mincho', serif;
    --font-shaal: 'Noto Serif JP', 'Yu Mincho', serif;
    --font-mob: 'Zen Maru Gothic', 'Meiryo', sans-serif;
    --font-latin: 'Cinzel', serif;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-narration);
    color: var(--ink-primary);
    line-height: 2;
    background: #2a1e14;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ═══ ヴィジュアルノベル風ヒーローイメージ ═══ */
.vn-hero {
    position: relative;
    width: 100%;
    height: 85vh;
    min-height: 500px;
    overflow: hidden;
}

.vn-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    filter: brightness(0.7) contrast(1.1);
}

.vn-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(42, 30, 20, 0.3) 0%,
        rgba(42, 30, 20, 0.1) 40%,
        rgba(42, 30, 20, 0.5) 70%,
        rgba(42, 30, 20, 0.95) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 5% 8%;
}

.vn-hero__number {
    font-family: var(--font-latin);
    font-size: 0.85rem;
    color: var(--accent-gold);
    letter-spacing: 0.6em;
    text-transform: uppercase;
    margin-bottom: var(--space-xs);
}

.vn-hero__title {
    font-family: var(--font-narration);
    font-size: 3.5rem;
    font-weight: 900;
    color: #f5e6c8;
    letter-spacing: 0.4em;
    text-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 0 60px rgba(0,0,0,0.3);
    margin-bottom: var(--space-xs);
}

.vn-hero__subtitle {
    font-family: var(--font-latin);
    font-size: 0.9rem;
    color: rgba(245, 230, 200, 0.6);
    letter-spacing: 0.5em;
    text-transform: uppercase;
}

/* ═══ 羊皮紙本体 ═══ */
.manuscript {
    max-width: 780px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    background:
        repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(160,130,90,0.04) 28px, rgba(160,130,90,0.04) 29px),
        radial-gradient(ellipse at 20% 50%, rgba(180,150,100,0.1) 0%, transparent 70%),
        radial-gradient(ellipse at 80% 30%, rgba(160,130,90,0.08) 0%, transparent 60%),
        linear-gradient(to bottom, var(--parchment-bg) 0%, var(--parchment-bg-dark) 30%, var(--parchment-bg) 60%, var(--parchment-bg-dark) 100%);
    background-color: var(--parchment-bg);
    box-shadow: inset 0 0 100px rgba(160,130,90,0.3), 0 0 60px rgba(0,0,0,0.5);
    position: relative;
}
.manuscript::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 80px rgba(100,70,40,0.25); pointer-events: none; z-index: 1;
}

/* ═══ シーン ═══ */
.scene {
    position: relative; z-index: 2;
    padding: var(--space-md) 0;
}

.scene-break {
    text-align: center;
    font-size: 1.5rem;
    color: var(--accent-gold);
    padding: var(--space-lg) 0;
    letter-spacing: 0.5em;
    opacity: 0.7;
    position: relative; z-index: 2;
}

/* ═══ 地の文 ═══ */
.narration {
    font-family: var(--font-narration);
    font-size: 1.05rem;
    line-height: 2.1;
    text-align: justify;
    margin-bottom: 1.5em;
    text-indent: 1em;
    color: var(--ink-primary);
}

.narration--inner {
    font-style: italic;
    color: var(--ink-secondary);
}

/* ═══ セリフ共通 ═══ */
.dialogue {
    margin: 1.2em 0;
    padding: 0.8em 1.2em;
    position: relative;
    border-radius: 2px;
}

.dialogue__speaker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 0.2em;
    text-transform: uppercase;
}

.dialogue__text {
    font-size: 1.08rem;
    line-height: 2;
}

/* ── セフィラのセリフ ── */
.dialogue--sephira {
    border-left: 3px solid var(--accent-gold);
    background: rgba(184, 150, 58, 0.04);
    padding-left: 1.5em;
}
.dialogue--sephira .dialogue__speaker { color: var(--accent-gold); }
.dialogue--sephira .dialogue__text {
    font-family: var(--font-sephira);
    color: var(--ink-secondary);
    font-weight: 500;
}
.dialogue--sephira.dialogue--long .dialogue__text {
    font-size: 1.02rem;
    line-height: 2.1;
}

/* ── シャールのセリフ ── */
.dialogue--shaal {
    border-left: 3px solid #6a7a8a;
    background: rgba(106, 122, 138, 0.04);
    padding-left: 1.5em;
}
.dialogue--shaal .dialogue__speaker { color: #5a6a7a; }
.dialogue--shaal .dialogue__text {
    font-family: var(--font-shaal);
    color: var(--ink-primary);
    font-weight: 600;
    letter-spacing: 0.03em;
}

/* ── モブ（ヴォルフ）のセリフ ── */
.dialogue--wolf {
    border-left: 3px solid #5a6a5a;
    background: rgba(90, 106, 90, 0.04);
    padding-left: 1.5em;
}
.dialogue--wolf .dialogue__speaker { color: #5a6a5a; }
.dialogue--wolf .dialogue__text {
    font-family: var(--font-mob);
    color: var(--ink-secondary);
    font-weight: 400;
    font-size: 1.02rem;
}

/* ── モブ（エルザ）のセリフ ── */
.dialogue--elza {
    border-left: 3px solid #7a6a8a;
    background: rgba(122, 106, 138, 0.04);
    padding-left: 1.5em;
}
.dialogue--elza .dialogue__speaker { color: #7a6a8a; }
.dialogue--elza .dialogue__text {
    font-family: var(--font-mob);
    color: var(--ink-secondary);
    font-weight: 400;
    font-size: 1.02rem;
}

/* ═══ ヴィジュアルノベル風 全幅挿絵 ═══ */
.vn-illustration {
    position: relative;
    width: calc(100% + var(--space-lg) * 2);
    margin-left: calc(-1 * var(--space-lg));
    margin-top: var(--space-lg);
    margin-bottom: var(--space-lg);
    z-index: 2;
}

.vn-illustration img {
    width: 100%;
    height: auto;
    display: block;
    filter: contrast(1.05) saturate(1.05);
    transition: filter 0.5s ease;
}

.vn-illustration img:hover {
    filter: contrast(1.1) saturate(1.1) brightness(1.02);
}

.vn-illustration__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 25px 30px 15px;
    background: linear-gradient(to top, rgba(42, 30, 20, 0.85) 0%, transparent 100%);
    font-size: 0.82rem;
    color: rgba(245, 230, 200, 0.7);
    letter-spacing: 0.15em;
    font-style: italic;
    text-align: right;
}

/* 小さめの挿絵（インライン） */
.illustration {
    margin: var(--space-lg) auto;
    max-width: 600px;
    text-align: center;
    position: relative; z-index: 2;
}
.illustration img {
    width: 100%;
    max-width: 550px;
    height: auto;
    border: 3px solid var(--border-ornate);
    padding: 6px;
    background: rgba(245, 230, 200, 0.5);
    box-shadow: 0 4px 20px var(--shadow-warm), inset 0 0 20px rgba(160,130,90,0.15);
    transition: box-shadow 0.4s ease, transform 0.4s ease;
}
.illustration img:hover {
    box-shadow: 0 8px 30px var(--shadow-deep), inset 0 0 20px rgba(160,130,90,0.2);
    transform: scale(1.01);
}
.illustration__caption {
    font-size: 0.8rem;
    color: var(--ink-light);
    margin-top: var(--space-sm);
    letter-spacing: 0.15em;
    font-style: italic;
}

/* ═══ 終幕 ═══ */
.episode-footer {
    text-align: center;
    padding: var(--space-xl) 0 var(--space-lg);
    border-top: 2px solid var(--border-ornate);
    margin-top: var(--space-xl);
    position: relative; z-index: 2;
}
.episode-footer__ornament {
    font-size: 1rem; color: var(--accent-gold); letter-spacing: 0.5em;
    margin-bottom: var(--space-md); opacity: 0.7;
}
.episode-footer__text {
    font-size: 0.85rem; color: var(--ink-light); line-height: 2.2; letter-spacing: 0.1em;
}
.episode-footer__author {
    display: inline-block; margin-top: var(--space-sm);
    font-size: 1rem; color: var(--ink-secondary); letter-spacing: 0.3em;
}

/* ═══ スクロールアニメーション ═══ */
.fade-in {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

.vn-illustration.fade-in {
    transform: translateY(30px) scale(0.98);
}

.vn-illustration.fade-in.visible {
    transform: translateY(0) scale(1);
}

/* ═══ レスポンシブ ═══ */
@media (max-width: 768px) {
    .manuscript { padding: var(--space-lg) var(--space-md); }
    .vn-hero__title { font-size: 2.4rem; letter-spacing: 0.3em; }
    .vn-hero { height: 70vh; min-height: 400px; }
    .narration { font-size: 0.98rem; }
    .dialogue { padding: 0.6em 1em; }
    .dialogue__text { font-size: 1rem; }
    .vn-illustration {
        width: calc(100% + var(--space-md) * 2);
        margin-left: calc(-1 * var(--space-md));
    }
}

@media (max-width: 480px) {
    .manuscript { padding: var(--space-md) var(--space-sm); }
    .vn-hero__title { font-size: 1.8rem; letter-spacing: 0.2em; }
    .vn-hero { height: 60vh; min-height: 350px; }
    .narration { font-size: 0.92rem; }
    .dialogue__text { font-size: 0.95rem; }
    .vn-illustration {
        width: calc(100% + var(--space-sm) * 2);
        margin-left: calc(-1 * var(--space-sm));
    }
}

/* ルビ */
ruby { ruby-align: center; }
rt { font-size: 0.6em; color: var(--ink-light); }

/* 選択色 */
::selection { background: rgba(184,150,58,0.3); color: var(--ink-primary); }

/* スクロールバー */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #2a1e14; }
::-webkit-scrollbar-thumb { background: var(--border-ornate); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }
