/* =========================================
   home-layout.css - 完全修正版
   ========================================= */

/* --- 基本設定：スクロールバーのカスタマイズ --- */
html, body {
    height: 100%;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent; /* Firefox用 */
    scrollbar-width: thin; /* Firefox用 */
}

/* Chrome, Safari, Edge用のカスタムスクロールバー */
::-webkit-scrollbar {
    width: 10px; /* スクロールバーの幅 */
}

::-webkit-scrollbar-track {
    background: transparent; /* トラックの背景（透明） */
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); /* スクロールバーの色 */
    border-radius: 10px; /* 丸み */
    border: 2px solid transparent; /* 隙間を作って細身に見せる */
    background-clip: content-box; 
    transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); /* ホバー時の色 */
    background-clip: content-box;
}

/* ★追加: 画面全体をFlexboxにしてフッターを下に押し下げる準備 */
body {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

/* ★追加: ホームやマイリスト画面が「余った空間」を全吸収して伸びる */
#home-view, 
#mylist-view, 
#gallery-view,
#main-content {
    flex: 1 0 auto !important; 
    width: 100%;
}

.nav-left a {
    text-decoration: none;
    outline: none;
}
.nav-logo {
    cursor: pointer;
}
/* スライダー行のスクロールバーも消す */
.movie-row::-webkit-scrollbar {
    display: none;
}
.movie-row {
    scrollbar-width: none;
    pointer-events: auto !important;
}

/* --- 変数定義 --- */
:root {
    --handle-width: 2%;
    --side-padding: 2.5%;
    --card-gap: 10px;      /* カード間の隙間 */
    --display-cards: 6;    /* 1画面に見せるカード数（PC標準） */
    --flixer-red: #e50914; /* 必要なら使うアクセントカラー */
    --gray-text: #b3b3b3;
}

/* 画面が少し狭い場合（ノートPCなど）は5枚表示にする */
@media (max-width: 1950px) {
    :root {
        --display-cards: 5 !important;
    }
}

.movie-row:hover {
    /* 必要なら z-index を上げる */
 
    position: relative;
}


.row-container {
    margin-bottom: 40px !important;
    position: relative;
    /* isolation を使うことで、z-index の管理を行内だけに閉じ込めます */
    isolation: isolate; 
    z-index: 1;
}

/* コンテンツ行全体の位置調整 */
.content-rows {
    padding: 10px 0;
    position: relative;
    z-index: 10;
    

}

/* 各行のタイトル（h3） */
.row-container h3 {
    margin: 35px 0 5px var(--side-padding); /* 左端をスライダーと合わせる */
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
    line-height: 1.2;
    pointer-events: auto;
}
.row-container:focus-within,
.row-container:hover {
    z-index: 10;
}
.slider-wrapper {
    position: relative;
    width: 100%;
    overflow: visible !important; 
    /* 下側に詳細パネルがはみ出すのを許可する */
    clip-path: inset(-100px 0px -500px 0px); 
}

.movie-row {
    display: flex;
    gap: var(--card-gap);
    padding: 10px var(--side-padding) 40px var(--side-padding) !important;
    overflow: visible !important;
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}
.movie-card-wrapper:hover {
    /* ホバーした時だけ、そのカードが行の枠を突き破って手前に来るようにする */
    z-index: 199999 !important;
}
/* 疑似要素の無効化（矢印の重複防止） */


.movie-row::after {
    content: "";
    display: block;
    flex: 0 0 var(--side-padding);
    min-width: var(--side-padding); /* ★重要：物理的な幅を確保 */
    margin-left: calc(-1 * var(--card-gap)); /* ★重要：gapによる二重余白を相殺 */
    height: 1px;
    pointer-events: none;
}
.slider-wrapper:has(#library-grid) .handle {
    /* (カード幅) * 9/19 + 上下パディング20px */
    height: calc(((100vw - (var(--side-padding) * 2) - (20px * 6)) / 7) * 9 / 19 + 20px) !important;
}


/* --- カード共通設定（ポスター・サムネ・ジャンル全て共通） --- */
/* ここで幅を計算し、全ての種類のカードで統一します */

.poster-card,
.resume-card,
.thumb-card,
.movie-card-wrapper.poster-card,
#resume-grid .resume-card {
    /* ★幅の計算式（超重要）
       (画面幅100% - (隙間10px × (枚数 - 1))) ÷ 枚数
       これにより、隙間を含めてピッタリ画面に収まります。


    */
    flex: 0 0 calc((100% - (var(--card-gap) * (var(--display-cards) - 1))) / var(--display-cards)) !important;
    width: calc((100% - (var(--card-gap) * (var(--display-cards) - 1))) / var(--display-cards)) !important;
    
    /* 隙間は親の gap で管理するため、marginは 0 にする */
    margin-right: 0 !important;
    margin-left: 0 !important;
    pointer-events: auto !important;
    border-radius: 15px !important;
    scroll-snap-align: start !important; /* 左端に吸着 */
    cursor: pointer;
    position: relative;
    transition: z-index 0.4s;
    z-index: 1; 
  
    overflow: hidden;
}

/* --- カード種類ごとの比率設定 --- */

/* ポスター型（縦長） */
.poster-card {
    aspect-ratio: 16 / 9 !important;
    background-color: #222;
    position: relative !important;
    overflow: hidden;
}

/* サムネイル型・ジャンル・続けて観る（横長） */
.resume-card, 
.thumb-card {
    aspect-ratio: 16 / 9 !important; /* 強制的に16:9 */
    background-color: #222;
    overflow: hidden;
}


/* --- 画像の表示ルール --- */
.poster-card img,
.resume-card img,
.thumb-card img {
    width: 100%;
    height: 100%;
    object-fit: cover !important; /* 枠に合わせてトリミング */
    object-position: center top;  /* 顔が見えるように上寄せ */
    display: block;
}


/* --- ホバーアクションは hover-card.css に統合したため削除 --- */




/* 端っこのカード基準点変更は hover-card.js に統合 */

.episode-name,
.resume-title, 
.resume-info,
.series-name {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* 下側にグラデーションを敷いて文字を読みやすくする */
    padding: 30px 10px 10px;
    background: linear-gradient(to top, rgba(0,0,0,1) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    color: white;
    font-size: 0.85rem;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    /* 初期状態：枠の下側に隠して透明にする */
    opacity: 0;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;
    z-index: 5;
    display: none !important; /* 役割を新しい詳細パネルに譲ったため非表示 */
}


/* その他の設定は変えずに維持してください */

/* ホバーしたら文字を出す */
.resume-card:hover .resume-title {
    opacity: 1;
}


/* --- 進捗バー（続けて観る用） --- */
.progress-container {
    width: calc(100% - 20px); /* ★カード幅より少し短くする（左右に10pxの余白） */
    height: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    position: absolute;
    bottom: 10px; /* ★下から少し浮かせる */
    left: 10px;  /* ★左側に余白を作る */
    z-index: 10;
    border-radius: 10px; /* 背景のバーも両端を丸くする */
    backdrop-filter: blur(4px);
}
.progress-bar {
    height: 100%;
    background-color: #ffffff;
    border-radius: 10px; /* ★右側だけではなく、両端を丸くする */
    transition: width 0.3s ease;
}
.resume-card .thumb-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%; /* 下から40%の高さまでグラデーションをかける */
    
    /* 下(黒80%) から 上(透明) へ向かうグラデーション */
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    
    z-index: 5; /* 画像より上で、プログレスバー(z-index:10)より下に配置 */
    pointer-events: none; /* マウスのクリックの邪魔をしないようにする */
}
.thumb-wrapper {
    position: relative;
    border-radius: 0 15px 7px 7px; /* ここに先ほど決めたカードの角丸を指定 */
    overflow: hidden; /* ★超重要！枠からはみ出たプログレスバーの角を切り取ります */
}
/* --- スクロールボタン（handle）設定 --- */
.handle {
    position: absolute;
    top: 0 !important;
    width: 3%; 
    height: calc((100vw / var(--display-cards)) * 9 / 16 + 20px);
    min-width: 35px;
    z-index: 20000 !important;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    pointer-events: auto !important;
}
.slider-wrapper:hover .handle:not(.is-at-edge) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
.slider-wrapper.is-scrolling .handle:not(.is-at-edge) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
}
.slider-wrapper:hover .handle.is-at-edge,
.handle.is-at-edge {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
}
body.disable-hover .slider-wrapper:hover .handle:not(.is-at-edge) {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}
/* スライダーにマウスが乗ったらボタンを表示 */
.slider-wrapper:hover .handle {
    opacity: 1 !important;
    pointer-events: auto !important;
}
.handle[style*="visibility: hidden"] {
    opacity: 0 !important;
    pointer-events: none !important;
}
/* アイコンのアニメーション */
.handle .material-symbols-outlined {
    display: inline-block; 
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    will-change: transform;
    backface-visibility: hidden;
    font-size: 3rem; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transform: scale(1);
}

/* ボタンホバーでアイコン拡大 */
.handle:hover .material-symbols-outlined {
    transform: scale(1.5); 
}

/* 左ハンドル */
.handle-left { 
    left: 0; 
    border-radius: 0 6px 6px 0; 
    background: linear-gradient(to right, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    justify-content: flex-start;
    padding-left: 2px;
}

/* 右ハンドル */
.handle-right { 
    right: 0; 
    border-radius: 6px 0 0 6px; 
    background: linear-gradient(to left, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    justify-content: flex-end;
    padding-right: 2px;
}

/* JSで制御する非表示クラス */
.handle.is-hidden,
.slider-wrapper .handle.is-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}


/* --- マイメディア（チャンネル）用の設定 --- */

/* ライブラリ用のカード（小さめ表示） */
#library-grid {
    /* ここで隙間の広さを決めます（30pxとか40pxとか自由に） */
    gap: 20px !important;
}
.library-card {
    /* 計算式: (100% - (隙間30px × 6箇所)) ÷ 7枚 */
    /* ※ gapを変えたら、ここの「30px」も同じ数字に変えてください */

    
    /* 比率：16:9 (横長) */
    aspect-ratio: 19 / 9 !important;
    border-radius: 25px !important;
    
    /* 以下は変更なし */
    flex: 0 0 auto;
    position: relative;
    overflow: hidden;

    margin: 0 !important; /* 余計なマージンは削除 */
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0.3s;
    z-index: 1;
    background-color: #333;
    pointer-events: auto !important;
}
@media (max-width: 1950px) {
    .library-card {

    width: calc((100% - (20px * 5)) / 6) !important;

}
.slider-wrapper:has(#library-grid) .handle {
        /* (カード幅) * 9/19 + 上下パディング20px */
        height: calc(((100vw - (var(--side-padding) * 2) - (20px * 5)) / 6) * 9 / 19 + 20px) !important;
    }
}
@media (min-width: 1951px) {
    .library-card {

    width: calc((100% - (20px * 6)) / 7) !important;

}

.inline-promo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
  
    max-height: 85vh !important;

    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
}




.movie-row > .library-card:nth-child(7n) {
    margin-right: 0 !important;
}

/* カード内の画像 */
.library-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* ロゴなどは真ん中に */
    transition: transform 0.3s ease;
}

/* ホバー時の動き */
.library-card:hover {
    transform: scale(1.1) !important;
    z-index: 200 !important;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

/* --- ライブラリ名を画像の上に重ねる場合のデザイン --- */
.library-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 10px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    
    /* 初期状態は透明 */
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10 !important;
    white-space: normal !important;
    line-height: 1.2;
}

/* ホバーした時だけ文字を出すならこれ */
.library-card:hover .library-title-overlay {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* --- ファイルの末尾、または適切な場所に追加 --- */
.slider-wrapper, .movie-row {
    /* 垂直方向のスクロール入力を常に許可する */
    touch-action: pan-y;
    overscroll-behavior-y: auto;
}



/* =========================================
   インラインおすすめ枠（自動生成バナー）
   ========================================= */
.inline-promo-container {
    margin: 40px 0 !important;
    padding: 0 var(--side-padding);
}
.promo-section-title {
    margin-left: 0 !important;
    margin-bottom: 15px !important;
    font-size: 1.4rem;
    font-weight: bold;
    color: white;
}
.inline-promo-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 60vh;

    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.inline-promo-wrapper:hover {
    
    box-shadow: 0 15px 40px rgba(0,0,0,0.8);
}
.promo-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;
}
.promo-bg img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 20%; 
}
.promo-gradient {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.4) 50%, transparent 100%),
                linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 50%);
    z-index: 3 !important;
}
.promo-content {
    position: relative; z-index: 5;
    width: 50%; height: 100%;
    display: flex; flex-direction: column; justify-content: center;
    padding-left: 5%;
}
.promo-buttons {
    /* 絶対配置にして位置を固定 */
    position: absolute;
    bottom: 17%; 
    left: 10%; /* 上のロゴの開始位置(padding)と左端を揃える */
    
    display: flex;
    gap: 40px; /* 変更：ボタン同士の間隔を広げる（20px → 40px） */
    
    /* ※ position: absolute; にしたため、以前の margin-top: 20px; は不要になります */
}
.promo-logo {
    width: 100%;
    max-width: 40vw; /* ロゴの最大幅 */
    max-height: 25vh; /* 縦に大きくなりすぎないように制限 */
    object-fit: contain;
    object-position: left bottom; /* 左下に揃える */
    margin-bottom: 30px;
    left: 20%;
    filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.6)); /* 映像の上でも見やすくする影 */
}

.promo-btn.info-btn {
    background-color: transparent !important; /* 背景を完全に消す */
    color: white !important;
    border: none !important; /* 枠線もなし */
    padding: 15px 20px; /* 背景がないので左右の余白は少し狭めでも綺麗です */
}

/* 詳細ボタンのホバーアクション（マウスが乗った時だけうっすら白く） */
.promo-btn.info-btn:hover {
    background-color: rgba(255, 255, 255, 0.15) !important; 
}
.promo-btn.play-btn {
    background-color: white !important;
    color: black !important;
    font-weight: 900; /* 文字をより太く */
}
.promo-btn.play-btn:hover {
    background-color: rgba(255, 255, 255, 0.8) !important;
    transform: scale(1.05); /* 1.05倍に拡大して強調 */
}
.promo-btn {
    display: inline-flex; 
    align-items: center; 
    gap: 12px;           /* アイコンと文字の隙間を広げる */
    padding: 15px 40px;  /* 上下・左右の余白を増やしてボタンを巨大化 */
    border-radius: 10px; /* 少し丸みを強くする */
    font-size: 1.4rem;   /* 文字サイズを大きく（元の1.1rem→1.4rem） */
    font-weight: bold;
    cursor: pointer; 
    border: none; 
    transition: 0.2s;
    width: fit-content;
}
.promo-btn:hover { background-color: rgba(255, 255, 255, 0.7); }


.promo-video-wrapper {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 2; /* 画像(1)の上、グラデーション(3)の下 */
    opacity: 0; /* 初期状態は透明 */
    transition: opacity 0.8s ease; /* ふんわり表示させる */
    pointer-events: none; /* マウス操作を透過 */
    overflow: hidden;
}

/* 16:9のYouTube動画を、画面の枠に合わせてトリミングするトリック */
.promo-video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
    transform: scale(1.35); /* 黒帯を消すために1.35倍に拡大 */
    pointer-events: none;
}


/* =========================================
   フッター（ホバーパネルのクッションを兼ねる）
   ========================================= */



.site-footer {
    /* ★追加: これが最強の魔法。フッターの上の空間を自動で広げて一番下に押しやる */
    margin-top: auto !important;
    flex-shrink: 0 !important; /* コンテンツが多くてもフッターが潰れないようにする */

    /* ★修正: 下の余白を少し削り、画面下にピタッと収まるように調整 */
    padding: 80px 0 40px 0; 
    
    /* 背景色をグラデーションだけでなく、ベースの色も指定して隙間を防止 */
    background-color: #0f0f0f; 
    background-image: linear-gradient(to bottom, transparent 0%, #0f0f0f 30%);
    
    color: #888;
    text-align: center;
    position: relative;
    z-index: 1; 
    
    /* 念のため要素全体がはみ出さないようにする */
    box-sizing: border-box; 
    width: 100%;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px; /* 要素間の隙間 */
}

/* トップへ戻るボタン */
.back-to-top-btn {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: white;
    transform: translateY(-3px); /* 浮き上がるアニメーション */
}

/* フッターリンク集 */
.footer-links {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

/* コピーライト */
.footer-copy {
    font-size: 0.85rem;
    opacity: 0.5;
    margin-top: 20px;
    margin-bottom: 0 !important; /* ★追加: 一番下のテキストの下に余計な隙間を作らない */
}


.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f0f0f; /* 背景と同じ黒で完全に隠す */
    z-index: 9999; /* 画面の一番手前に持ってくる */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    transition: opacity 0.3s ease; /* 消える時のふんわりアニメーション */
}

/* くるくる回るスピナー */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #ffffff; /* 白いくるくる */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.home-new-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background-color: #FFFFFF; /* Prime Video風の青 */
    color: black;
    font-size: 14px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 7px;
    z-index: 999; /* 画像より手前に出す */
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* =========================================
   スクロール中のホバー誤検知ブロック（完全・最終版）
========================================= */


body.disable-hover::after {
    content: '';
    position: fixed; /* 画面全体に固定 */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999; /* どの要素よりも一番手前に配置 */
    background: transparent; /* 完全に透明 */
}


.library-card .poster-info-panel,
.library-card .resume-title,
.library-card .resume-info {
    display: none !important;
}
body {
    font-family: 'Noto Sans JP', sans-serif;
}

/* --- ナビゲーションバー全体のスタイル --- */
header#navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 2.5% !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10000; /* ホバーしたカード(9999)よりも常に手前に表示させる */
    transition: background-color 0.3s ease;
    height: 70px; /* 高さを固定 */
}

/* スクロール時の濃い背景 (Prime Video風) */
header#navbar.nav-black {
    /* 1. 背景色を「真っ黒（#000000）」から「60%透けた黒」に変更 */
    background-color: rgba(0, 0, 0, 0.7); 
    
    /* 2. ★魔法★ 背後の要素をぼかす（数字が大きいほど強くぼやけます） */
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px); /* Safari（iPhoneなど）用 */
    
    /* 3. 影は少し残して立体感を出す */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7); 
}

/* ヒーロー上の透明背景 (既存) */
header#navbar.nav-transparent {
    background-color: transparent;
}

/* --- 左側の配置 --- */
.nav-left {
    display: flex;
    align-items: center;
    gap: 25px !important;
}

/* ロゴのスタイル */
.nav-logo {
    height: 40px; /* Prime Videoのロゴのように */
    width: auto;
}

/* --- タブリストのスタイル --- */
.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0 !important; /* タブ同士の間隔 */
    margin: 0;
    padding: 0;
}
.nav-links li {
    margin: 0 !important;
    padding: 0 !important;
    display: flex;
}
/* 各タブの共通スタイル */
.nav-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7); 
    font-size: 16px;
    font-weight: 700; 
    border-radius: 10px; /* ← ご自身で調整された10px！素晴らしいです！ */
    transition: color 0.2s ease, background 0.3s ease, border 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid transparent; 

    /* ▼ ここから追加・修正（文字のズレを直す魔法） ▼ */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* フォント特有の余分な上下の隙間を消す */
    
    /* もし line-height: 1; を入れてもまだ下にズレて見える場合は、
       padding: 8px 18px 10px; （上を少し狭く、下を少し広く）
       のように微調整すると、視覚的に完璧な中央になります！
    */
    padding: 12px 14px; 
}

.nav-links a:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1); /* うっすら白く光る */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 10px;
}

/* --- [★修正] アクティブなタブのスタイル（Prime Video風） --- */
.nav-links a.active {
    color: #ffffff;
    
    /* 1. 背景は「わずかな白」にして、透け感を出す */
    background: rgba(255, 255, 255, 0.08); 
    
    /* 2. ★最大の魔法★ 二重ガラスの濁りを防ぐため、ボタンのぼかしは「消す」！ */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    
    /* 3. その代わり、フチの光の反射（白線）を少し強めにしてガラスの輪郭を出す */
    border: 1px solid rgba(255, 255, 255, 0.25); 
    
    /* 4. 内側にうっすらとハイライトを入れて、ガラスの厚みを表現 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* --- 右側の配置 (既存、再確認) --- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right .icon {
    color: #ffffff;
    cursor: pointer;
    font-size: 24px;
}

.user-profile img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ffffff;
}



/* =========================================
   検索画面 (オーバーレイ) のスタイル
   ========================================= */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85); /* 濃いめのすりガラス背景 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999; /* ナビゲーションより上に表示 */
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 検索画面が開いた時のクラス */
.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 検索窓のヘッダー部分 */
.search-header {
    display: flex;
    align-items: center;
    padding: 30px 5%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
}

.search-icon-large {
    font-size: 40px;
    color: rgba(255, 255, 255, 0.5);
    margin-right: 20px;
}

/* 検索入力フォーム */
#search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 36px;
    font-weight: 700;
    outline: none;
    font-family: 'Noto Sans JP', sans-serif;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 閉じるボタン */
.close-search {
    font-size: 40px;
    color: #ffffff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-search:hover {
    transform: scale(1.1);
}

/* 検索結果のコンテナ */
.search-results-container {
    flex: 1;
    padding: 0 5% 50px 5%;
    overflow-y: auto;
}

.search-meta {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    font-weight: 700;
}

/* 結果を並べるグリッド（行ではなく折り返して並べる） */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}


/* ナビゲーションバー */
#navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 68px;
    padding: 0 2.5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    transition: background-color 0.4s ease; /* 色がじわっと変わるアニメーション */
    box-sizing: border-box;
}

/* 透明状態 */
.nav-transparent {
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
}

/* 黒背景状態 (スクロール後) */
.nav-black {
    background-color: #000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.nav-left { display: flex; align-items: center; gap: 40px; }
.nav-logo { height: 30px; }

.nav-links {
    list-style: none; display: flex; gap: 20px; padding: 0; margin: 0;
}
.nav-links li {
    color: #e5e5e5; font-size: 14px; cursor: pointer; transition: 0.3s;
}
.nav-links li:hover, .nav-links li.active { color: white; font-weight: bold; }

.nav-right { display: flex; align-items: center; gap: 20px; color: white; }
.user-profile img { width: 32px; height: 32px; border-radius: 4px; cursor: pointer; }
.icon { cursor: pointer; }


#navbar.nav-scrolled, 
#navbar.nav-black {
    box-shadow: none !important; /* 立体感用の影を削除 */
    border-bottom: none !important; /* 万が一 border があっても消す */
}

/* 詳細ページ表示中、特定の要素が原因で線が出る場合の保険 */
body[data-tab="details"] #navbar,
#details-view #navbar {
    box-shadow: none !important;
}


.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 0 2.5%; /* index.htmlのマイリスト等の余白と合わせる */
    margin-top: 25px;
    margin-bottom: 10px;
}

/* タイトル自体の余白をリセット */
.section-title-wrapper h3 {
    margin: 0 !important;
    font-size: 1.4rem;
    color: #f5f5f5;
}

/* 「すべて見る」ボタンのデザイン（Prime Video風） */
.view-all-btn {
    background: none;
    border: none;
    color: #f5f5f5; /* 落ち着いた青色 */
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 15px 0;
    transition: color 0.2s, opacity 0.2s;
}



.view-all-btn .material-symbols-outlined {
    font-size: 1.5rem;
    margin-left: 2px;
}

/* モバイル対応：画面が狭いときは文字を小さく */
@media (max-width: 768px) {
    .section-title-wrapper {
        padding: 0 15px;
    }
    .section-title-wrapper h3 {
        font-size: 1.1rem;
    }
    .view-all-btn {
        font-size: 0.8rem;
    }
}



/* =========================================
   モバイル完全対応 (グリッド＆将来の下部タブ用)
   ========================================= */

@media (max-width: 768px) {
    :root {
        --display-cards: 4 !important; /* タブレットなどは4列 */
        --side-padding: 4%;
    }
    .nav-links li {
        display: none; /* スマホではヘッダーのテキストリンクを隠してスッキリさせる */
    }
    .nav-links li:first-child {
        display: block; /* ホームタブだけ残すか、ロゴのみにするならこれも消す */
    }
    .row-container h3 {
        font-size: 1.1rem;
        margin: 20px 0 5px var(--side-padding);
    }
    .movie-row {
        gap: 8px; /* カードの隙間を狭く */
        padding-bottom: 20px !important;
    }
    
    /* 将来の下部固定タブのための余白確保 */
    body {
        padding-bottom: 70px !important; /* スマホのみ下に余白を作る */
    }
    .site-footer {
        padding-bottom: 90px; /* フッターも下部タブに隠れないようにする */
    }
}

@media (max-width: 480px) {
    :root {
        --display-cards: 3 !important; /* 個人的にはスマホは3列(Prime Video風)か2列 */
    }
    .nav-left .nav-logo {
        height: 24px; /* ロゴも少し小さく */
    }
}