/* ─── リセット ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ─── ベース ─── */
body {
    font-family: 'Hiragino Kaku Gothic Pro', 'Yu Gothic', sans-serif;
    overflow: hidden;
    height: 100vh;
    height: 100dvh; /* モバイルアドレスバー対応 */
    background: #f4f0eb;
}
.bungee-regular {
  font-family: "Bungee", sans-serif;
  font-weight: 400;
  font-style: normal;
}

/* ─── Section2: 漫画ビューワー ─── */
#section2 {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ─── スクロールテキスト（最上部・最前面） ─── */
.scroll-text-container {
    position: fixed;
    top: 2%;
    left: 0;
    width: 100%;
    height: 60px;
    backdrop-filter: blur(8px);
    z-index: 1000; /* 最前面 */
    overflow: hidden;
    display: flex;
    align-items: center;
    pointer-events: none; /* クリック・タッチを下に貫通させる */
}

.scroll-text-track {
    display: flex;
    gap: 80px;
    white-space: nowrap;
    animation: scrollText 150s linear infinite;
}
.scroll-text-track span {
    font-size: 2rem;
    color: #ff7070;
}
.scroll-text-item {
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* 6個のうち3個分（半分）移動でループ */
    }
}

/* モバイル調整 */
@media (max-width: 760px) {
    
    .scroll-text-track {
        gap: 60px;
    }
}

/* ─── 漫画スライダー ─── */
.manga-slider {
    display: flex;
    flex-direction: row;
    height: 100%;
    will-change: transform;
    touch-action: pan-y; /* 縦スクロールは許可・横スワイプのみ拿る */
}

/* ─── 各ページ ─── */
.manga-page {
    min-width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #f4f0eb; /* 古い紙風の背景 */
    flex-shrink: 0;
    overflow: hidden;
}

/* ─── レスポンシブ調整 ─── */

/* モバイル（デフォルト）：画像最大幅 450px */
.page-wrap {
    position: relative;
    /* A5 = 148mm × 210mm → 比率 148:210 ≈ 0.705 */
    width: min(91vw, 450px, 100vh * 0.705);
    height: min(100vh, 450px / 0.705, 90vw / 0.705);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* タブレット・デスクトップ（760px以上） */
@media (min-width: 760px) {
    .page-wrap {
        width: min(70vw, 70vh * 0.705);
        height: min(80vh, 70vw / 0.705);
    }

    .final-content h2 {
        font-size: 1.75rem;
    }

    .final-btn {
        padding: 18px 44px;
        font-size: 1.1rem;
    }
}

/* 特に小さいスマホ */
@media (max-height: 600px) {
    .page-wrap {
        width: min(90vw, 450px, 75vh * 0.705);
        height: min(75vh, 450px / 0.705, 90vw / 0.705);
    }

    .final-content {
        gap: 20px;
    }

    .final-content h2 {
        font-size: 1.1rem;
    }

    .final-btn {
        padding: 12px 28px;
        font-size: 0.9rem;
    }
}
.manga-page img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    /* 紙のような影 */
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.12),
        0 8px 32px rgba(0, 0, 0, 0.18),
        0 1px 2px rgba(0, 0, 0, 0.08);
    border-radius: 1px;
    /* 画像保護 */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none; /* iOS長押し保存メニュー抑制 */
    pointer-events: none;        /* イベント貫通で、スライダーのドラッグを優先 */
}

/* ─── ページめくりシャドー（左辺に影） ─── */
.turn-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.08) 40%,
        transparent 100%
    );
    pointer-events: none;
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
}

/* めくり中の状態：左辺のシャドーが広がる */
.manga-page.turning-out .turn-shadow {
    width: 60%;
}

/* めくり直後の新ページ：右側からシャドーが飛び込んで消える */
.manga-page.turning-in .turn-shadow {
    position: absolute;
    top: 0;
    left: auto;
    right: 0;
    width: 40%;
    background: linear-gradient(
        to left,
        rgba(0, 0, 0, 0.22) 0%,
        rgba(0, 0, 0, 0.06) 50%,
        transparent 100%
    );
    animation: shadowFadeIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes shadowFadeIn {
    0% {
        width: 50%;
        opacity: 1;
    }
    100% {
        width: 0%;
        opacity: 0;
    }
}

/* ─── 最終ページ ─── */
.manga-page.final-page {
    background: linear-gradient(0deg, #bbe59d, #6496f2);
}

.final-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 0 24px;
    text-align: center;
}

.final-deco-line {
    width: 48px;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.final-content h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.04em;
    line-height: 1.5;
}

.final-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 36px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 40px;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
}

.final-btn:hover,
.final-btn:active {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-arrow {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.final-btn:hover .btn-arrow,
.final-btn:active .btn-arrow {
    transform: translateX(4px);
}

/* ─── スワイプヒント ─── */
.swipe-hint {
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 100;
    pointer-events: none;
    animation: hintPulse 2.2s ease-in-out infinite;
}

.swipe-arrow {
    font-size: 1.6rem;
    color: rgb(255 3 3 / 70%);
}

.swipe-text {
    font-size: 0.65rem;
    color: rgb(255 0 0 / 50%);
    letter-spacing: 0.12em;
    writing-mode: horizontal-tb;
}
@keyframes hintPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateY(-50%) translateX(0);
    }
    50% {
        opacity: 1;
        transform: translateY(-50%) translateX(-12px);
    }
}

.swipe-hint.hidden {
    display: none;
}

/* ─── ページインジケーター ─── */
.page-indicator {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    gap: 8px;
    z-index: 100;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator-dot.active {
    width: 24px;
    background: rgba(255, 255, 255, 0.9);
}
