.home-body {
    background-color: var(--black-pure) !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    min-height: 100vh;
}

/* ナビゲーションバー */



/* ヒーローセクション */
/* --- ヒーロースライダー修正 --- */

.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    /* はみ出し防止 */
    display: flex;
    align-items: center;
}

/* 背景画像専用のdiv (フェード用) */
.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    transition: opacity 0.5s ease-in-out;
    /* フワッと変わる */
    z-index: 0;
    /* コンテンツより背面に配置 */
    background-color: #000000 !important;
    overflow: hidden;
}

.backdrop-layer.active {
    opacity: 1;
    z-index: 2;

}

.backdrop-layer {
    position: absolute;
    /* これがないと重なりません */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center top;
    opacity: 0;
    /* 基本は透明 */
    transition: opacity 0.8s ease-in-out;
    /* 切り替えをスムーズに */
    z-index: 1;
}

/* 矢印ボタン */
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    opacity: 0;
    /* 最初は隠してホバーで出す */
}

.hero:hover .slider-arrow {
    opacity: 1;
}

/* マウスを乗せたら矢印出現 */
.slider-arrow:hover {
    background: white;
    color: black;
}

.slider-arrow.left {
    left: 20px;
}

.slider-arrow.right {
    right: 20px;
}

/* ドットインジケーター */
/* ヒーローセクションのドットを右側に縦並びにする */




/* 文字エリアのアニメーション用クラス */
.fade-in {
    animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* グラデーションオーバーレイ (文字を読みやすくする魔法) */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.8) 0%,
            rgba(0, 0, 0, 0.4) 40%,
            transparent 100%);
    z-index: 1;
}

/* 下部のフェードアウト */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 450px;
    /* 少し高さを出して、リストとの繋ぎ目を自然に */
    background: linear-gradient(to top, #000, transparent);
    z-index: 2;
}


.hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* 全ての子要素を左寄せに固定 */
    position: relative;
    z-index: 10;
    padding-left: 2.5%;
    width: 40%;
    color: white;
}

.hero-title {
    font-size: 60px;
    margin-bottom: 10px;
    line-height: 1.1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* --- hero-meta の配置修正（決定版） --- */
.hero-meta {
    display: flex;
    align-items: center;
    /* 要素全体を中央に */
    gap: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #fff;
    /* 行の高さを1に固定して、余計な余白を消す */
    line-height: 1;
}

/* メタ情報の各項目共通 */
.hero-meta span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1.5rem;
    /* 高さを統一して中心を出しやすくする */
}

/* ★「2025」や「映画」など、枠がないプレーンなテキストの微調整 */
.hero-meta span:not(.rating) {
    /* 視覚的な重心を合わせるため、1〜2px下にずらす */
    transform: translateY(1px);
}

/* ★レーティングタグ（PG12など）の枠線の修正 */
.hero-meta .rating {
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0 6px;
    /* 上下パディングを0にして、heightで高さを制御 */
    height: 1.3rem;
    /* テキストよりわずかに低くするとバランスが良い */
    border-radius: 3px;
    font-size: 0.85rem;
    background: rgba(0, 0, 0, 0.2);
    /* 枠の中の文字も中央に */
    display: flex;
    align-items: center;
}

.tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    font-size: 12px;
    border-radius: 2px;
}

.hero-desc {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    /* 3行で省略 */
}

.hero-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 23px;
    margin-top: 15px;

    /* 🌟 強力な追加：自身の幅を中身に限定する */
    width: max-content !important;
    align-self: flex-start;
}

.btn-play {
    background: white;
    color: black;
    border: none;
    padding: 13px 35px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;

    /* 🌟 強力な追加：リロード時の伸びを物理的に禁止 */
    width: auto !important;
    max-width: fit-content !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
}

.btn-play:hover {
    background: rgba(255, 255, 255, 0.75);
}

.btn-play .material-symbols-outlined {
    font-size: 2.2rem;
    /* 再生アイコンを強調 */
}

.btn-info .material-symbols-outlined {
    font-size: 2.0rem;
    /* インフォメーションアイコンを強調 */
}

.btn-list {
    background: rgba(109, 109, 110, 0.7);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.btn-list:hover {
    background: rgba(109, 109, 110, 0.4);
}

/* 詳細情報ボタンのベース（正円） */
.btn-info {
    position: relative;
    /* ツールチップの基準点 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    /* 正円にするために幅と高さを固定 */
    height: 60px;
    padding: 0;
    /* 余計なパディングを削除 */
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    /* まん丸にする */
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-info:hover {
    background-color: rgba(109, 109, 110, 0.9);
    border-color: white;
}

/* ホバー時に浮かび上がるテキスト（ツールチップ） */
.btn-info::after {
    content: '詳細情報';
    /* 浮かび上がる文字 */
    position: absolute;
    bottom: 130%;
    /* ボタンの少し上に配置 */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255, 255, 255, 1);
    color: black;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: bold;
    white-space: nowrap;
    /* 改行防止 */
    opacity: 0;
    /* 通常時は隠す */
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    /* マウス反応を無効化 */
}

/* ホバーした時に表示 */
.btn-info:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
    /* 少し上に動かしながら表示 */
}








/* --- 予告編動画用の追加設定 --- */
#hero-section {
    position: relative;
    /* 子要素の基準にする */
    background-size: cover;
    background-position: center;
    transition: background-image 1s ease-in-out;
}

#hero-section {
    position: relative;
    z-index: 0;
}

#hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #141414;
    background-size: cover;
    /* 全画面を覆う */
    background-position: right center !important;
    z-index: -2;
    transition: background-image 0.8s ease-in-out;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    /* グレーではなく、完全な黒（#000000）のグラデーション */
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.9) 0%,
            /* 左端はほぼ真っ黒 */
            rgba(0, 0, 0, 0.6) 20%,
            /* 徐々に薄く */
            rgba(0, 0, 0, 0) 45%
            /* 右側は完全に透明 */
        ) !important;
    z-index: 10 !important;
    pointer-events: none;
}

@media (min-width: 121em) {

    /* 1. 全体の背景を黒に */
    #hero-section {
        background-color: var(--black-pure);
    }

    /* 2. 背景画像（黄金比の 90vw！） */
    #hero-backdrop {
        width: 90vw !important;
        /* ★ 右側90%を画像エリアにする */
        height: 100% !important;
        left: auto !important;
        /* 左側はフリーにする（10%の黒い隙間ができる） */
        right: 0 !important;
        /* 右端にピッタリ固定する */

        background-size: cover !important;
        background-position: right top !important;

        padding-top: 10vh;
        z-index: 1;
        background-color: var(--black-pure);
    }

    /* 3. グラデーション（90vwに合わせた極上のフェード） */
    .hero-overlay {
        position: absolute;
        inset: 0;
        width: 100vw !important;
        height: 100%;
        z-index: 5 !important;
        pointer-events: none;

        background: linear-gradient(to right,
                var(--black-pure) 0%,
                var(--black-pure) 10%,
                /* ★ 左の余白(10%)に合わせて完全な黒をキープ */
                rgba(0, 0, 0, 0.85) 20%,
                /* 画像の始まり(10vw~)を滑らかに暗くする */
                rgba(0, 0, 0, 0.4) 35%,
                /* スーッと透けさせる */
                transparent 55%
                /* 画面の右半分は鮮やかなまま！ */
            ) !important;
    }

    .hero {
        position: relative;
        height: 100vh;
        width: 100%;
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    /* 4. 文字エリア */
    .hero-content {
        width: 35% !important;
        padding-left: 2.5%;
        z-index: 10 !important;
    }

    /* 5. 予告編動画 */
    #trailer-container {
        width: 90vw !important;
        height: 100% !important;
        left: auto !important;
        right: 0 !important;
        overflow: hidden !important;
        z-index: 2;

    }
}



/* style.css の #trailer-container を以下に書き換え */
#trailer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    /* 基本は透明 */
    visibility: hidden;
    overflow: hidden !important;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    /* ここが重要 */
    z-index: 1;
    pointer-events: none;
}

#trailer-container iframe {
    position: absolute;

    /* 1. 上下の中央に配置する魔法 */
    top: 50% !important;
    transform: translateY(-50%) !important;

    /* 2. 背景画像と同じく、右端を基準にする */
    right: 0 !important;
    left: auto !important;

    /* 3. 16:9比率を維持したまま、画面をビッシリ埋める計算式 */
    /* 画面の高さ(vh)に対して、横幅を自動計算する */
    width: 177.77vh !important;
    /* 100vh * (16 / 9) */
    height: 100vh !important;
    /* 高さは常に画面いっぱい */

    /* ウルトラワイドモニターなどで横が足りなくなるのを防ぐ保険 */
    min-width: 100vw !important;
    min-height: 56.25vw !important;
    /* 100vw * (9 / 16) */

    pointer-events: none;
}

/* ついでに video タグ（ローカル動画用）も完璧にしておきます */
#trailer-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

#trailer-container.visible {
    opacity: 1 !important;
    visibility: visible !important;
}

#trailer-container iframe,
#trailer-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
}

/* 文字などが動画より上に来るように調整 */
.hero-vignette {
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    z-index: 10 !important;
}

.mute-btn {
    position: absolute;
    right: 5%;
    bottom: 15%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 65px;
    height: 65px;
    display: none !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    transition: all 0.3s;
}


/* ★成功の鍵：動画コンテナに .visible がついた時だけ、ボタンを flex にする */
#trailer-container.visible~#mute-toggle,
#trailer-container.visible+#mute-toggle {
    display: flex !important;
}


.mute-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#mute-toggle.mute-btn .material-symbols-outlined {
    font-size: 42px;
    /* アイコンを大きく */
    font-variation-settings: 'FILL' 0, 'wght' 300;
    /* 線を少し細くすると綺麗です */
}







/* ロゴ画像のサイズ調整 */
.hero-logo {
    /* 1. サイズの制御：高解像度なソースを維持しつつ、表示領域に収める */
    width: auto;
    height: 30vh !important;
    max-width: 35vw;
    /* ロゴを少し大きく見せたい場合はここを調整 */
    max-height: 30vh;
    /* Netflixのロゴサイズ感に近い数値 */

    /* 2. 描画品質の維持 */
    object-fit: contain;
    object-position: left center;
    /* 左揃えにする場合 */

    /* 3. 視認性の向上：高精細な画像ほど、背景との分離に影が役立ちます */
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.6));

    /* 4. ブラウザのレンダリングを最高画質に強制 */
    image-rendering: -webkit-optimize-contrast;

    margin-bottom: 25px;
    transition: opacity 0.5s ease-in-out;
}

/* ロゴがない時のテキスト用スタイル（既存のh1に合わせて調整） */
#hero-title {
    font-size: 3rem;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* 通常時の設定 */
/* --- 通常時 --- */
#hero-desc {
    max-width: 34vw;
    opacity: 1;

    /* --- ここが重要：数値を固定して計算を止めます --- */
    font-size: 1.1rem;
    /* 文字サイズを固定 */
    line-height: 1.5rem;
    /* 1行を 1.5rem に固定 */
    height: 4.5rem;
    /* 1.5rem × 3行 ＝ 4.5rem で箱の大きさを完全に固定 */
    /* ------------------------------------------- */

    margin-top: 15px;
    margin-bottom: 25px;

    /* 三点リーダーの設定（3行で制限） */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;

    /* 安定したtransitionのためにheightに戻す */
    transition:
        opacity 0.8s ease,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.8s ease,
        margin-bottom 0.8s ease,
        height 0.8s ease;

    backface-visibility: hidden;
    will-change: transform, opacity;
}

/* 予告再生中：下に収納する */
.is-trailer-playing #hero-desc {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(30px);


    transition:
        opacity 0.6s ease,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        margin-top 0.8s ease,
        margin-bottom 0.8s ease,
        height 0.8s ease,
        visibility 0s linear 0.8s;

    visibility: hidden;
}

#hero-title-container {
    min-height: 120px;
    /* 🌟 追加：ロゴがなくても高さを確保して、ボタンが上に跳ねるのを防ぐ */
    display: flex;
    align-items: flex-end;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left bottom;
}

.hero-meta {
    transition: transform 0.8s ease;
}

.is-trailer-playing #hero-title-container {

    transform: scale(0.9) translateY(105px);
}

/* --- 予告再生中：メタ情報の移動 --- */
.is-trailer-playing .hero-meta {
    opacity: 0;
    /* 説明文と一緒に下に下がりながら消えるようにする */
    /* タイトルと同じ、または少し違う数値にすると奥行きが出ます */
    transform: translateY(60px);

    pointer-events: none;
    visibility: hidden;

    /* 動きを滑らかにする設定 */
    transition:
        opacity 0.6s ease,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0s linear 0.8s;
}

/* --- タイトルコンテナのベース設定（transitionを確認） --- */
#hero-title-container {
    /* 1.2sだとゆっくりすぎる場合は 0.8s くらいに合わせると説明文と同期します */
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: left bottom;
}



/* ヒーローセクション全体の設定 */
#hero-section {
    opacity: 1;
    /* 0.5秒かけて変化させる設定 */
    transition: opacity 0.5s ease-in-out !important;
    will-change: opacity;
    /* ブラウザに「ここは変化するよ」と伝えて最適化を防ぐ */
}

/* ★フェードアウト（暗転）：ここが重要 */
.section-fade-out {
    opacity: 0 !important;
    /* ここにもtransitionを書くことで確実に適用させる */
    transition: opacity 0.5s ease-in-out !important;
}

/* フェードイン（表示） */
.section-fade-in {
    /* 0.8秒かけて表示 */
    animation: blinkOpen 0.8s ease-out forwards;
}

@keyframes blinkOpen {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


/* =========================================
   ヒーローセクション：横並びサムネイルナビゲーション
   ========================================= */



/* モバイル専用パーツは PC版では一切表示しない */
#mobile-hero-dots.mobile-only {
    display: none;
}

.hero-dots:not(.mobile-only) {
    position: absolute !important;
    right: 2.5% !important;
    bottom: 2.5% !important;
    top: auto !important;
    transform: none !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 0.3vw !important;
    z-index: 100 !important;
    align-items: center;
    max-width: 90vw !important;

    /* ★ 超重要：大きくなった時にはみ出た部分（角丸）が切り取られないようにする！ */
    overflow: visible !important;
}

.hero-dots::-webkit-scrollbar {
    display: none;
}

/* 生成されるサムネイル画像のデザイン */
.hero-thumb {
    width: 4vw !important;
    /* ★ 修正：「15vw」から「3.5vw」に大幅縮小！ */
    height: calc(3.5vw * 9 / 16) !important;
    /* ★ 高さは自動で16:9になります */
    border-radius: 8px !important;
    /* ★ 小さくなったので角丸も少しシャープに調整 */
    object-fit: cover;
    cursor: pointer;
    opacity: 0.4;

    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.8);
    flex-shrink: 0;
}

/* マウスホバーで少し明るく・浮き上がる */
.hero-thumb:hover {
    opacity: 0.9;

}

/* 現在表示中の作品（アクティブ状態） */
.hero-thumb.active {
    opacity: 1;
    border-radius: 8px !important;
    transform: scale(1.2) !important;
    margin: 0 0.4vw !important;
}