/* xclip Phase 1 — Tailwind CSS で大半カバー、ここは補助 */

/* ===== 横スクロール完全防止 (どんなスマホ幅でも画面ぴったり・一瞬でも横ブレさせない) =====
   overflow-x: clip はスクロールコンテナを生成しないので position:sticky/fixed ヘッダーを壊さない
   (overflow-x:hidden だと sticky が無効化される)。古いブラウザ用に hidden もフォールバックで残す。 */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

/* line-clamp polyfill (Tailwind に組込みあるが Safari 古い版対応) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* fade-in for newly inserted tiles (motion でも上書きされる) */
.video-tile {
    animation: fadeInUp 0.4s ease-out backwards;
}
.video-tile:nth-child(2) { animation-delay: 0.04s; }
.video-tile:nth-child(3) { animation-delay: 0.08s; }
.video-tile:nth-child(4) { animation-delay: 0.12s; }
.video-tile:nth-child(5) { animation-delay: 0.16s; }
.video-tile:nth-child(6) { animation-delay: 0.20s; }
.video-tile:nth-child(7) { animation-delay: 0.24s; }
.video-tile:nth-child(8) { animation-delay: 0.28s; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Cloudflare Turnstile — ダークテーマに馴染ませる */
.cf-turnstile {
    margin: 4px 0;
}

/* スクロールバー (Chromium 系) を細く + ダーク */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #13131a; }
::-webkit-scrollbar-thumb { background: #2a2a36; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #4a4a5e; }

/* モバイルナビ等のスクロールバー非表示 */
.scrollbar-none { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-none::-webkit-scrollbar { display: none; }

/* タッチデバイス: hover を tap で出ないように軽減、active 強調 */
@media (hover: none) {
    .video-tile:hover { transform: none !important; }
    button:active, a:active { opacity: 0.7; }
}

/* iOS Safari の input ズーム抑止 (font-size 16px 以上必須) */
@media (max-width: 640px) {
    input[type="text"], input[type="url"], input[type="email"], textarea, select {
        font-size: 16px;
    }
}

/* ===== マイクロインタラクション ===== */
/* タイルの hover で軽い光彩 (Dark Neon ブランド強化) */
.video-tile {
    will-change: transform;
}
.video-tile:focus-within {
    outline: 2px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
}

/* ボタン押下時の触覚的フィードバック (active scale) */
button:not(:disabled):active, .btn-x-out:active {
    transform: scale(0.96);
}

/* スケルトンローディング (無限スクロール待機中の体感速度UP) */
.skeleton-tile {
    aspect-ratio: 16 / 9;
    background: linear-gradient(110deg, #1c1c25 30%, #2a2a36 50%, #1c1c25 70%);
    background-size: 200% 100%;
    border-radius: 1rem;
    animation: skeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes skeletonShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* リンクの focus visible 強化 (キーボード操作 a11y) */
a:focus-visible, button:focus-visible {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== 広告スロット (Dark Neon に馴染ませる、過度に目立たない) ===== */
.xclip-adslot {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 0.75rem;
    background: rgba(28, 28, 37, 0.4);
    border: 1px solid rgba(124, 92, 246, 0.15);
    overflow: hidden;
    /* 広告本体は中央寄せ、外部スクリプトの幅自動調整に任せる */
    text-align: center;
    min-height: 50px;
}
.xclip-adslot iframe, .xclip-adslot ins, .xclip-adslot img {
    max-width: 100%;
    height: auto;
}
.xclip-adslot-tile {
    grid-column: 1 / -1; /* グリッド内では全幅取得 */
}

/* prefers-reduced-motion 対応 (アクセシビリティ規格) */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== モバイル最適化 (33Agent並列リサーチ統合実装) ===== */

/* iOS Safari: tap時の青色フラッシュ抑止 */
* { -webkit-tap-highlight-color: transparent; }

/* iOS の text-size-adjust を 100% に固定(none禁止) — OS フォントスケール尊重 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Safe-area: ノッチ・Dynamic Island・iPhone ホームインジケータ対応 */
body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Cross-document View Transitions (Chrome 126+/Safari 18.2+で全ページ遷移にフェード、非対応はスキップ) */
@view-transition { navigation: auto; }

/* オーバースクロール抑制(モバイルbounceを抑える、コンテナ単位は別途) */
html, body { overscroll-behavior-y: none; }

/* ===== タイル aspect-ratio 自動判定 (JS で xclip-portrait/square/landscape 付与) ===== */
.xclip-portrait img { object-position: center top; }

/* ===== メイソンリー (TWIVIDEO 風: サムネを元の縦横比で表示) ===== */
/* grid-row span を JS が画像読込後に計算して各タイルに付与。row-gap=0 + タイル margin で
   縦の間隔を均一化。列数は Tailwind の grid-cols-* がそのまま効く。 */
.xclip-masonry {
    grid-auto-rows: 8px;
    row-gap: 0;
    column-gap: 0.625rem;     /* 10px (mobile) */
    align-items: start;       /* span 分に引き伸ばさず content 高さで描画 */
}
@media (min-width: 640px) {
    .xclip-masonry { column-gap: 1rem; }  /* 16px */
}
.xclip-masonry > .video-tile { margin-bottom: 0.625rem; }
@media (min-width: 640px) {
    .xclip-masonry > .video-tile { margin-bottom: 1rem; }
}
/* メイソンリー時のサムネは固定 16:9 を解除し、画像の自然な縦横比で表示 */
.xclip-masonry .video-tile a > img { width: 100%; height: auto; display: block; }

/* ===== サムネ ホバープレビュー (PC): mouseover で mp4 を無音再生 ===== */
.xclip-hover-preview {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; z-index: 6;
    opacity: 0; transition: opacity .18s ease; /* playing 時にJSが opacity=1 → 黒箱を出さずフェードイン */
}

/* ===== カスタム動画プレイヤー (動画詳細 /v/{id}) =====
   Tailwind はビルド方式なので、ここに全スタイルを直書きする (未ビルドクラス禁止)。 */
.xc-player {
    position: relative;
    /* ★アスペクト比ロック (2026-06-14 ぽいさん指示: 再生中にサイズが踊るバグ修正)。
       HLS は回線で変種 (480p/720p/1080p…全部同比率) を切替えるが、video が width/height:auto
       だと「変種のネイティブ解像度」に表示サイズが追従して再生中にコロコロ変わる。
       → 枠 (.xc-player) を動画のアスペクト比に固定し、video はその枠を object-fit:contain で
         満たす。変種が切り替わっても枠は不変・低解像度は upscale されるだけ (歪まない)。
       --xc-ar = videoWidth/videoHeight。JS が初回 loadedmetadata で確定しロックする (customPlayer)。
       未確定時は 16/9 をデフォルトにしてメタデータ前のレイアウトジャンプを抑える。
       縦長 (9/16 等): aspect-ratio で幅から高さが出るが max-height:80vh を超えないよう
         max-width を calc(80vh * ar) で頭打ちにする (はみ出し防止)。横長は max-width:100% が効く。 */
    --xc-ar: 16 / 9;
    aspect-ratio: var(--xc-ar);
    width: 100%;
    /* aspect-ratio + max-height の両立: 高さ上限 80vh から逆算した幅 (= 80vh * ar) を幅上限にして
       縦長動画のはみ出しを防ぐ。横長は 100% が先に効く。--xc-ar-num = videoWidth/videoHeight の
       数値 (JS が設定)。既定 16/9≈1.7778 で CSS 単独でも破綻しない。 */
    max-width: min(100%, calc(80vh * (var(--xc-ar-num, 1.7778))));
    max-height: 80vh;
    margin-left: auto;
    margin-right: auto;
}
/* メイン動画はクリックで再生切替するのでカーソルをポインタに。
   ★枠いっぱい (width/height:100%) + object-fit:contain = 変種が変わっても表示サイズ不変・歪まず。 */
.xc-player > video:not([data-xc-preview]):not([data-xc-buffer]) {
    cursor: pointer;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* 次動画の先読みバッファ (無限スワイプ用)。インライン display:none が剥がれても絶対に出さない。 */
.xc-player video[data-xc-buffer] { display: none !important; }

/* ★ネイティブ controls フォールバック用のアスペクト比ロック箱 (XCLIP_CUSTOM_PLAYER=false 時)。
   .xc-player と同じ思想: 枠を動画比率に固定し video は枠を contain で満たす。
   JS (initAspectBoxes) が loadedmetadata で --xc-ar / --xc-ar-num を確定・ロックする。 */
.xc-aspect-box {
    position: relative;
    --xc-ar: 16 / 9;
    aspect-ratio: var(--xc-ar);
    width: 100%;
    max-width: min(100%, calc(80vh * (var(--xc-ar-num, 1.7778))));
    max-height: 80vh;
    margin-left: auto;
    margin-right: auto;
}
.xc-aspect-box > video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* CSS 疑似全画面 (.xc-fs-fake): 実 Fullscreen API が使えない端末 (iOS Safari 等) のフォールバック。
   同じ DOM のまま画面全体を占有するので、ダブルタップ±10s・長押し2倍速等の既存ジェスチャーが全画面中も生きる
   (ネイティブ video 全画面に落とすと効かなかったための改修。2026-06-11 ぽいさん指示)。 */
.xc-fs-fake {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* ★全画面では枠の高さ上限を 100svh (なければ 100vh) に拡張し、画面いっぱいに。
       aspect-ratio はそのまま (動画比率) なので歪まない。max-height:80vh を上書き。
       margin auto は flex 中央寄せで不要なので 0 に戻す。 */
    max-height: none !important;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* 疑似全画面中の枠 (.xc-player 自身): アスペクト比を保ったまま画面いっぱい。
   高さ上限 = 100svh、それに合わせて幅上限 = 100svh * ar。横長は幅 100vw が先に効く。 */
.xc-fs-fake[data-xc-player] {
    aspect-ratio: var(--xc-ar);
    width: 100vw;
    max-width: min(100vw, calc(100svh * (var(--xc-ar-num, 1.7778))));
    height: auto;
    max-height: 100svh;
    margin: 0;
}
/* svh 非対応端末向けフォールバック (上の svh 宣言を上書きしないよう前に置けないので併記)。 */
@supports not (height: 100svh) {
    .xc-fs-fake[data-xc-player] {
        max-width: min(100vw, calc(100vh * (var(--xc-ar-num, 1.7778))));
        max-height: 100vh;
    }
}
/* 疑似全画面中の video: 枠 (= 動画比率) を contain で満たす。歪まず・変種切替でもサイズ不変。 */
.xc-fs-fake > video:not([data-xc-preview]):not([data-xc-buffer]) {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* 疑似全画面中は背面スクロールを止める (位置は JS が保存・復元)。
   position:fixed + top のインライン指定は JS (enterFakeFullscreen) が付ける。
   overscroll-behavior:none で iOS のスクロール貫通 (rubber-band) も殺す。 */
.xc-noscroll { overflow: hidden; overscroll-behavior: none; }

/* 下スワイプで全画面を閉じる最中: 動画を指に追従させ背景を減衰させる (X 風)。
   transform/opacity はインラインで JS が毎フレーム更新。transition は離した時だけ JS が付ける。 */
.xc-fs-fake.xc-dismissing { background: #000; }
.xc-fs-fake.xc-dismissing > video:not([data-xc-preview]):not([data-xc-buffer]) {
    will-change: transform;
}

/* 全画面 ✕ ボタン: 左上固定・44px タッチターゲット・半透明黒丸・safe-area 考慮。 */
.xc-fs-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    -webkit-tap-highlight-color: transparent;
}
.xc-fs-close svg { width: 24px; height: 24px; }
.xc-fs-close[hidden] { display: none; }

/* コントロールバー: 下部グラデーション。X 動画 UX 準拠の 2 段構成。safe-area 下端を考慮。
   上段 (.xc-row-track) = シークバー単独で全幅 / 下段 (.xc-row-btns) = ボタン類。
   これでスマホでも track がコンテナ全幅になり精密シーク可能 (改修の主目的)。 */
.xc-controls {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, rgba(0,0,0,0) 100%);
    z-index: 8;
    transition: opacity 0.25s ease;
}
.xc-controls.xc-hidden { opacity: 0; pointer-events: none; }

/* 上段: シークバー単独。左右パディング小 (8px) で全幅に近づける。 */
.xc-row-track {
    display: flex;
    align-items: center;
    padding: 0 8px;
}
/* 下段: ボタン類を横並び。スペーサーで vol/mute/fs を右寄せ。 */
.xc-row-btns {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.xc-spacer { flex: 1 1 auto; }

/* ボタン: 44px タッチターゲット確保 */
.xc-controls button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px; min-height: 40px;
    padding: 6px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
}
.xc-controls button:hover { background: rgba(255,255,255,0.14); }
.xc-controls button svg { width: 22px; height: 22px; display: block; }
@media (max-width: 640px) {
    .xc-controls button { min-width: 44px; min-height: 44px; }
}

/* 時間表示 */
.xc-time {
    color: #fff;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* シークバー: 全幅 + 高さ広めのタップ領域 + 細い見た目のバー (X 動画 UX 準拠) */
.xc-track {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    min-width: 40px;
    height: 28px;          /* タップ領域は広く (X 風) */
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;    /* pointer ドラッグでスクロールさせない */
}
.xc-track::before {        /* 見た目のトラック (細いバー) */
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    transition: height 0.15s ease;
}
.xc-track-fill {
    position: relative;
    height: 4px;
    width: 0%;
    border-radius: 2px;
    background: #8b5cf6;
    pointer-events: none;
    transition: height 0.15s ease;
}
.xc-track:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 4px; border-radius: 4px; }

/* ドラッグ/タッチ中: バーが太くなり (4px→8px)、fill 先端に丸いつまみを出す (X 方式) */
.xc-track.xc-scrubbing::before { height: 8px; }
.xc-track.xc-scrubbing .xc-track-fill { height: 8px; }
.xc-track.xc-scrubbing .xc-track-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translate(50%, -50%);
    width: 14px; height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ★長押し 2 倍速バッジ (X 本家準拠): 上部中央・半透明黒地白文字。記号のみで i18n 不要。 */
.xc-rate-badge {
    position: absolute;
    top: 12px;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(4px);
}
.xc-rate-badge[hidden] { display: none; }

/* ダブルタップ/ボタン ±10s の視覚フィードバック: 左右に円形フラッシュ (約 600ms フェードアウト)。 */
.xc-skip-badge {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 84px; height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    z-index: 9;
    pointer-events: none;
    opacity: 0;
}
.xc-skip-back { left: 12%; }
.xc-skip-fwd  { right: 12%; }
.xc-skip-badge[hidden] { display: none; }
.xc-skip-badge.xc-skip-flash {
    animation: xc-skip-flash 0.6s ease forwards;
}
@keyframes xc-skip-flash {
    0%   { opacity: 0; transform: translateY(-50%) scale(0.7); }
    25%  { opacity: 1; transform: translateY(-50%) scale(1); }
    100% { opacity: 0; transform: translateY(-50%) scale(1); }
}

/* ★読み込み中スピナー: バッファ待ちで JS が出し入れ (waiting/stalled → 200ms → 表示)。
   中央配置・表示専用レイヤー (pointer-events:none) でジェスチャーと一切干渉しない。
   ポスターマスク(7)/コントロール(8) より上、ループバッジ等と同層 (z-index:11)。 */
.xc-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 11;
    pointer-events: none;
}
.xc-spinner[hidden] { display: none; }
.xc-spinner-ring {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.18);
    border-top-color: #ec4899;       /* neon-pink: 既存トークンに合わせる */
    animation: xc-spinner-spin 0.8s linear infinite;
}
@keyframes xc-spinner-spin {
    to { transform: rotate(360deg); }  /* transform のみ (リフロー無し) */
}
.xc-spinner-label {
    max-width: 80vw;
    padding: 0 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.xc-spinner-label:empty { display: none; }   /* 短尺はラベル空 = リングだけ */

/* ══ 全画面 無限スワイプフィード ══════════════════════════════════════════
   次/前の動画のポスター (サムネ) を下/上からスライドインさせる単一の再利用要素。
   transform/opacity のみアニメ (ぬるぬる)。JS が毎フレーム transform を更新する。 */
.xc-feed-poster {
    position: absolute;
    inset: 0;
    z-index: 7;                 /* video の上・xc-controls(8) の下 */
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    pointer-events: none;
}
.xc-feed-poster img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
/* ★S1-0 デュアルバッファ: 温めた次/前動画の本物の第1フレームを出す入場 video。
   ポスター img と同じ全面 contain。hidden 時は出さない (= 従来のポスター img フォールバック)。 */
.xc-feed-poster video[data-xc-stage] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}
.xc-feed-poster video[data-xc-stage][hidden] { display: none; }
.xc-feed-poster[hidden] { display: none; }

/* ★改修1: 退場スナップショット canvas。fastSwap で現フレームを描画し、ポスター(入場)の
   裏で上/下へスライドアウトして読み込みギャップを隠す。z-index は poster(7) と同じく
   video の上・controls(8) の下。描画は JS が letterbox 計算で行う (canvas は黒背景)。 */
.xc-feed-snap {
    position: absolute;
    inset: 0;
    z-index: 6;                 /* video の上・入場ポスター(7) の下 (退場は入場の裏でスライド) */
    background: #000;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.xc-feed-snap[hidden] { display: none; }

/* 画面下部の @handle (+ タイトル1行) オーバーレイ。全画面中のみ JS が出す。 */
.xc-feed-meta {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 8;
    padding: 1.5rem 1rem calc(3.25rem + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.xc-feed-meta[hidden] { display: none; }
.xc-feed-title {
    font-size: 13px;
    color: rgba(255,255,255,0.92);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.xc-feed-title[hidden] { display: none; }

/* 投稿者チップ (左下)。overlay は pointer-events:none だがチップだけ auto = タップで /v/{id} へ。
   頭文字アバター(円・グラデ) + @handle。video.blade.php L72 のチップと同じ雰囲気。 */
.xc-feed-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-bottom: 8px;
    padding: 5px 12px 5px 5px;
    border-radius: 999px;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    text-decoration: none;
    max-width: 70%;
    pointer-events: auto;       /* overlay の none を上書き = チップだけ押せる */
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.xc-feed-chip:hover, .xc-feed-chip:active { border-color: rgba(124,92,246,0.6); background: rgba(0,0,0,0.6); }
.xc-feed-chip[hidden] { display: none; }
.xc-feed-chip-av {
    width: 28px; height: 28px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c5cf6 0%, #ec4899 100%);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 12px; font-weight: 700;
}
.xc-feed-chip-name {
    font-size: 14px; font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* 右レール (いいね/お気に入り)。全画面中のみ JS が出す。縦中央〜やや下、画面右端。
   z-index 9 = xc-controls(8) より上・退場スナップ(6)/ポスター(7) より上。pointer-events:auto。 */
.xc-feed-rail {
    position: absolute;
    right: 10px;
    bottom: 22%;
    z-index: 9;
    display: flex;
    flex-direction: column;
    gap: 18px;
    pointer-events: auto;
}
.xc-feed-rail[hidden] { display: none; }
.xc-rail-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: 0;
    padding: 4px;
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.xc-rail-ic {
    width: 48px; height: 48px;
    border-radius: 999px;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.12s ease, background 0.15s ease;
}
.xc-rail-btn:active .xc-rail-ic { transform: scale(0.88); }
.xc-rail-ic svg { width: 28px; height: 28px; display: block; }
.xc-rail-n {
    font-size: 12px; font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}
/* アクティブ色: いいね=ピンク / お気に入り=オレンジ。SVG を currentColor で塗りつぶす。 */
.xc-rail-on-like { color: #ec4899; }
.xc-rail-on-fav  { color: #f59e0b; }
.xc-rail-btn.is-active .xc-rail-ic svg { fill: currentColor; }
@media (prefers-reduced-motion: reduce) {
    .xc-rail-ic, .xc-rail-btn:active .xc-rail-ic { transition: none; transform: none; }
}

/* 初回ヒントの「スワイプで次の動画」テキスト (1 セッション 1 回、フェード)。 */
.xc-feed-hint {
    position: absolute;
    left: 50%;
    bottom: calc(18% + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 11;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.xc-feed-hint.is-on { opacity: 1; }

/* ドラッグ中の GPU 昇格 (ぬるぬる化)。JS が willChange を付け外しするが CSS 側でも保険。 */
.xc-fs-fake.xc-dismissing .xc-feed-poster { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
    .xc-feed-hint { transition: none; }
}

/* 音量スライダー: 細いバー (幅 ~72px)。アクセントは既存のピンク系。 */
.xc-vol {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 72px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.3);
    cursor: pointer;
    margin: 0;
    outline: none;
}
.xc-vol::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ec4899;
    border: 0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.xc-vol::-moz-range-thumb {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #ec4899;
    border: 0;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.xc-vol:focus-visible { outline: 2px solid #8b5cf6; outline-offset: 4px; }
/* タッチ端末でも音量スライダーは表示する (Android は video.volume が効くので有用)。
   iOS だけは OS が代入を無視する (ハード音量ボタンのみ) ため JS 側で display:none する。
   旧 @media (hover:none){ .xc-vol{display:none} } は全タッチ端末を消していたので撤去。 */
/* 下段バーが狭いスマホで溢れないよう、スライダー幅をモバイルで縮める。 */
@media (max-width: 640px) {
    .xc-vol { width: 56px; }
}

/* シークプレビュー: track 上の該当位置に表示する小窓 */
.xc-preview {
    position: absolute;
    bottom: 56px;          /* コントロールバーの上 */
    bottom: calc(56px + env(safe-area-inset-bottom));
    left: 0;
    width: 160px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.15);
    z-index: 9;
    pointer-events: none;
}
.xc-preview[hidden] { display: none; }
.xc-preview video {
    display: block;
    width: 100%;
    height: auto;
    background: #000;
}
.xc-preview-time {
    position: absolute;
    bottom: 4px; left: 50%;
    transform: translateX(-50%);
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
@media (max-width: 640px) {
    .xc-preview { width: 120px; }
}

/* いいね/お気に入り: アクティブ時はアイコンを塗りつぶし */
.btn-like.is-active svg, .btn-fav.is-active svg { fill: currentColor; }

/* フォロー中ボタン */
.btn-follow.is-following {
    background: rgba(168, 85, 247, 0.28);
    color: #fff;
    border-color: rgba(168, 85, 247, 0.6);
}

/* ===== 動画詳細 SP スティッキー下部アクションバー (md 以上では表示しない) ===== */
.xclip-detail-actionbar {
    position: fixed;
    bottom: 64px;  /* Bottom Nav の上に重ねる */
    bottom: calc(64px + env(safe-area-inset-bottom));
    left: 0; right: 0;
    z-index: 35;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(28, 28, 37, 0.6);
    padding: 0.5rem 0.75rem;
}

/* ===== Bottom Navigation Bar ===== */
.xclip-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 40;
}
/* メインコンテンツがボトムナビに隠れないよう下余白 (SP のみ表示) */
@media (max-width: 767px) {
    main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}

/* ===== Headroom: スクロール方向でヘッダー自動隠し/表示 ===== */
.xclip-header {
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
}
.xclip-header.is-hidden { transform: translateY(-100%); }

/* ===== WCAG コントラスト補強 (white on neon-pink 3.53:1 → text-shadow で実効性UP) ===== */
.bg-gradient-to-r.from-neon-600,
.bg-gradient-to-r.from-neon-pink {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* ===== Toast / Snackbar ===== */
.xclip-toast-container {
    position: fixed;
    bottom: max(72px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    width: min(92vw, 360px);
    pointer-events: none;
}
.xclip-toast {
    pointer-events: auto;
    padding: 0.875rem 1rem;
    border-radius: 0.75rem;
    font-size: 0.9rem;
    background: rgba(28, 28, 37, 0.95);
    backdrop-filter: blur(8px);
    color: #fff;
    border: 1px solid rgba(124, 92, 246, 0.3);
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
    animation: xclip-toast-slide-in 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.xclip-toast.is-success { border-color: rgba(34, 197, 94, 0.5); }
.xclip-toast.is-error   { border-color: rgba(239, 68, 68, 0.5); }
.xclip-toast.is-leaving { animation: xclip-toast-fade-out 0.25s ease forwards; }
@keyframes xclip-toast-slide-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes xclip-toast-fade-out {
    to { opacity: 0; transform: translateY(8px); }
}

/* SVG は HTML の [hidden] UA スタイルが効かないブラウザ差があるため明示 (アイコン切替の保険) */
.xc-controls svg[hidden], .xc-player svg[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   ★スマホ全画面 = TikTok 式 UI (.xc-fs-mobile スコープ、2026-06-12 ぽいさん指示)
   付与: 全画面 enter 時 matchMedia('(pointer:coarse)') なら JS が container に付ける。
   PC・非全画面には一切影響しない (このクラスが付かないため)。
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 中央 再生/停止インジケータ (TikTok 式・全プラットフォーム共通の DOM、表示はモバイル全画面のみ) ──
   一時停止中に大きな白 ▶ を表示し続け、再生再開で短くフェードアウト。pointer-events:none。 */
.xc-center-state {
    position: absolute;
    top: 50%; left: 50%;
    z-index: 9;                 /* controls(8) より上・スピナー(11) より下 */
    width: 64px; height: 64px;
    color: #fff;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.22,1,0.36,1);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
    display: none;              /* 既定は非表示。モバイル全画面でのみ display 解禁 (下) */
}
.xc-center-state svg { width: 100%; height: 100%; display: block; }
.xc-center-state[hidden] { display: none !important; }
.xc-fs-mobile .xc-center-state { display: block; }
.xc-fs-mobile .xc-center-state.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* 再生再開時のフェードアウト (is-on 除去 + leaving 付与で短く消える) */
.xc-fs-mobile .xc-center-state.xc-center-leaving { opacity: 0; transform: translate(-50%, -50%) scale(1.15); }
@media (prefers-reduced-motion: reduce) {
    .xc-center-state { transition: opacity 0.12s ease; }
    .xc-fs-mobile .xc-center-state.is-on,
    .xc-fs-mobile .xc-center-state.xc-center-leaving { transform: translate(-50%, -50%) scale(1); }
}

/* ── 右上ミュートトグル (モバイル全画面のみ表示・✕ の対角) ── */
.xc-fs-mute {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top));
    right: calc(12px + env(safe-area-inset-right));
    width: 36px; height: 36px;
    display: none;              /* 既定は非表示。モバイル全画面でのみ表示 (下) */
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(6px);
    color: #fff;
    cursor: pointer;
    z-index: 10000;             /* ✕ と同層 */
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
    -webkit-tap-highlight-color: transparent;
}
.xc-fs-mute svg { width: 20px; height: 20px; display: block; }
.xc-fs-mobile .xc-fs-mute { display: flex; }

/* ── ★右上タップで開く縦音量スライダー (2026-06-12: 0/100 トグル → 任意調整へ) ──
   ミュートボタン直下に縦パネル。input[type=range] を -90° 回転して縦ドラッグ化。
   touch-action:none でブラウザのスクロール奪取を防ぎ、スライダー操作を安定させる。 */
.xc-fs-vol {
    position: absolute;
    top: calc(56px + env(safe-area-inset-top));   /* ミュートボタン(36px+12px)の直下 */
    right: calc(12px + env(safe-area-inset-right));
    z-index: 10000;
    width: 36px; height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 18px;
    backdrop-filter: blur(6px);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}
.xc-fs-vol[hidden] { display: none; }
/* ★v59: 回転 range は実機タッチで操作不能 (Pixel 6 実機テストで発覚) → 自前縦トラックに置換 */
.xc-fs-vol-track {
    position: relative;
    width: 6px; height: 108px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.28);
    touch-action: none;            /* ブラウザにジェスチャを渡さない (ドラッグ安定) */
    cursor: pointer;
}
.xc-fs-vol-track::before {
    /* タップ領域の拡張 (見た目 6px のまま当たり判定 36px) */
    content: '';
    position: absolute;
    inset: -8px -15px;
}
.xc-fs-vol-fill {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 100%;
    border-radius: 3px;
    background: #fff;
    pointer-events: none;
}

/* ── ★タップ安定化 (2026-06-12): レール/チップ/右上ボタンはブラウザにジェスチャを渡さない ──
   touch-action:none が無いと、指が数 px 動いた時点でブラウザがパン判定して pointercancel を
   発火し「押したのに反応しない」になる (setPointerCapture とセットで根絶)。 */
.xc-feed-rail, .xc-rail-btn, .xc-feed-chip, .xc-fs-mute { touch-action: none; }

/* ── 下部コントロール: シークバーだけに (モバイル全画面のみ) ──
   ボタン列 (±10s/再生/音量/ミュート/全画面) は非表示。機能はタップ/ダブルタップ/長押し/
   右上ミュート/✕ で全代替済み。シークバーは画面最下端に細く常時表示。 */
.xc-fs-mobile .xc-row-btns { display: none; }
.xc-fs-mobile .xc-controls {
    /* グラデ背景を薄く・下端ぴったりへ。シークバー単独表示用に余白を詰める。 */
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 100%);
    padding: 0 0 calc(4px + env(safe-area-inset-bottom));
    gap: 0;
}
.xc-fs-mobile .xc-row-track { padding: 0; }
/* シークバーは最下端に細く。tap 領域は維持 (.xc-track の height:28px はそのまま)。 */
.xc-fs-mobile .xc-track { height: 22px; }
.xc-fs-mobile .xc-track::before { height: 3px; left: 0; right: 0; border-radius: 0; }
.xc-fs-mobile .xc-track-fill { height: 3px; border-radius: 0; }
/* ★コントロール自動非表示中でもシークバーだけは薄く見せ、常時シーク可能にする。
   .xc-hidden は opacity:0+pointer-events:none だが、モバイル全画面では track 行のみ復活させる。 */
.xc-fs-mobile .xc-controls.xc-hidden { opacity: 1; }
.xc-fs-mobile .xc-controls.xc-hidden .xc-row-track { opacity: 0.55; pointer-events: auto; }
.xc-fs-mobile .xc-controls.xc-hidden .xc-time { opacity: 0; }  /* 時間表示は隠す (バーだけ残す) */

/* ── 左下チップ + メタ文をシークバーと被らせない (bottom を底上げ) ── */
.xc-fs-mobile .xc-feed-meta {
    padding-bottom: calc(1.75rem + env(safe-area-inset-bottom));
}

/* ═══ ★レール デザイン刷新 (最新 SNS 級・背景円廃止・白アイコン+強シャドウ・小さめ) ═══
   PC 全画面にも適用 (統一感)。サイズ感はモバイル基準で小さめ (ボタン~40px / アイコン~26px)。 */
.xc-rail-ic {
    width: 40px; height: 40px;
    border-radius: 999px;
    background: transparent;            /* ★背景円を廃止 */
    backdrop-filter: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.85));  /* 視認性確保の強シャドウ */
    transition: transform 0.12s ease;
}
.xc-rail-ic svg { width: 26px; height: 26px; }
.xc-rail-n {
    font-size: 11px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9), 0 0 2px rgba(0,0,0,0.7);
}
/* レール本体: 右端・下寄り。シークバー/メタと被らない高さへ。 */
.xc-feed-rail { bottom: 18%; gap: 14px; }
/* ★押した瞬間のポップ (scale 0.85→1.25→1、バウンス ~350ms)。押下中は軽く縮む。 */
.xc-rail-btn:active .xc-rail-ic { transform: scale(0.85); }
.xc-rail-ic.xc-rail-pop { animation: xc-rail-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes xc-rail-pop {
    0%   { transform: scale(0.85); }
    45%  { transform: scale(1.25); }
    100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .xc-rail-ic.xc-rail-pop { animation: none; }
    .xc-rail-btn:active .xc-rail-ic { transform: none; }
}

/* ── 日別アーカイブ カレンダーモーダル (JS+CSS 自作、ライブラリ不使用) ──
   サイトのダークネオン基調 (ink-900 背景 / neon-500 アクセント / 角丸 / backdrop-blur)。
   resources/css/app.css の CSS 変数 (--color-ink-* と --color-neon-*) を参照して配色を統一する。
   ※コメント内に「アスタリスク+スラッシュ」の並びを書くとコメントが早期終了して直後のルールが
     パーサに食われる (v63-64 でモーダルの position:fixed が丸ごと無効化されていた実バグ)。
   モバイル操作性のためセルは 44px 目安。xclip.js 末尾の IIFE が #xc-cal を制御する。 */
.xc-cal-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    /* ★ふわっと開閉 (2026-06-13 ぽいさん指示): JS が hidden 解除→次フレームで .xc-cal-open を
       付け外しし、ここの transition で背景フェード+モーダル浮き上がりを両方向アニメさせる。 */
    opacity: 0;
    transition: opacity 0.32s ease;
}
.xc-cal-overlay.xc-cal-open { opacity: 1; }
.xc-cal-overlay[hidden] { display: none; }
.xc-cal-modal {
    width: 100%;
    max-width: 360px;
    background: var(--color-ink-900, #0a0a0f);
    border: 1px solid rgba(124, 92, 246, 0.25);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.08);
    padding: 16px;
    /* 浮き上がり: 28px 下 + 縮小から、柔らかい ease-out で定位置へ (閉じは逆再生で沈む) */
    opacity: 0;
    transform: translateY(28px) scale(0.94);
    transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.xc-cal-overlay.xc-cal-open .xc-cal-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .xc-cal-overlay, .xc-cal-modal { transition: none; }
}
.xc-cal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.xc-cal-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}
.xc-cal-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--color-ink-300, #aaa9c0);
    background: transparent;
    transition: background 0.15s, color 0.15s;
}
.xc-cal-x:hover { background: var(--color-ink-700, #1c1c25); color: #fff; }
.xc-cal-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.xc-cal-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: var(--color-ink-200, #d4d3e0);
    background: var(--color-ink-800, #13131a);
    transition: background 0.15s, color 0.15s;
}
.xc-cal-arrow:hover { background: var(--color-ink-700, #1c1c25); color: var(--color-neon-500, #8b5cf6); }
.xc-cal-month {
    flex: 1;
    text-align: center;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}
.xc-cal-dow {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}
.xc-cal-dow span {
    text-align: center;
    font-size: 0.7rem;
    color: var(--color-ink-400, #7a7a92);
    padding: 4px 0;
}
.xc-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
.xc-cal-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
    color: var(--color-ink-500, #4a4a5e);
    background: transparent;
}
.xc-cal-cell.xc-cal-empty { background: transparent; }
.xc-cal-cell.xc-cal-on {
    color: #fff;
    background: var(--color-ink-800, #13131a);
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.xc-cal-cell.xc-cal-on:hover {
    background: var(--color-neon-600, #7c3aed);
}
.xc-cal-cell.xc-cal-on:active { transform: scale(0.92); }
.xc-cal-cell.xc-cal-current {
    background: linear-gradient(135deg, var(--color-neon-600, #7c3aed), var(--color-neon-pink, #ec4899));
    color: #fff;
    font-weight: 700;
}
.xc-cal-cell.xc-cal-off {
    color: var(--color-ink-600, #2a2a36);
    cursor: default;
}
@media (prefers-reduced-motion: reduce) {
    .xc-cal-modal { animation: none; }
    .xc-cal-cell.xc-cal-on:active { transform: none; }
}

/* ══════════════════════════════════════════════════════════════════════════
   動画スワイプ大改修 (UnratedX級・2026-06-22) — body.xc-swipe2 スコープ限定
   ──────────────────────────────────────────────────────────────────────────
   通常表示 (.xc-player / 非フラグ) は一切触らない。全ルールが `.xc-swipe2` 配下。
   狙い: ①疑似全画面枠を「動画比率」→「画面固定フルスクリーン」に ②同動画サムネの
   ぼかし背景で黒帯を充填 → スワイプ毎の位置ズレ消滅・全動画で一貫カバー率。
   ★`--xc-ar` を使う通常枠サイズ計算は削除しない (フラグ OFF では従来どおり)。
   ══════════════════════════════════════════════════════════════════════════ */

/* (B) 疑似全画面枠を画面固定フルスクリーンに (aspect-ratio 衝突を解除)。 */
.xc-swipe2 .xc-fs-fake[data-xc-player] {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    aspect-ratio: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
}
@supports not (height: 100svh) {
    .xc-swipe2 .xc-fs-fake[data-xc-player] { height: 100vh; }
}

/* (A) 同動画サムネのぼかし背景充填 (poster/img・video 複製はしない=HLS 破綻回避)。
   最背面 z-index:0。inset:-24px + scale で blur の縁の透けを潰す。 */
/* ★通常表示(非全画面)には絶対漏らさない: 背景要素は全画面突入時に生成され退出後も DOM に残るため、
   既定で display:none。全画面 (.xc-fs-fake) のときだけ表示する。 */
.xc-swipe2 .xc-feed-bg { display: none; }
.xc-swipe2 .xc-fs-fake .xc-feed-bg {
    display: block;
    position: absolute;
    inset: -24px;
    z-index: 0;
    overflow: hidden;
    background: #000;
    pointer-events: none;
}
.xc-swipe2 .xc-feed-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(34px) brightness(.5) saturate(1.3);
    transform: scale(1.18);
}

/* (C) メイン video = 画面固定フルスクリーン枠を contain で満たす (歪ませない既存方針)。
   背景 img は video 要素でないため video セレクタには元から掛からないが、SPEC 準拠で
   data-xc-bg/stage/buffer/preview を明示除外。z-index:1 で背景の上・オーバーレイ群の下。 */
.xc-swipe2 .xc-fs-fake[data-xc-player] > video:not([data-xc-preview]):not([data-xc-buffer]):not([data-xc-stage]):not([data-xc-bg]) {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: transparent;
}

/* (D) スワイプ演出レイヤー (入場ポスター/退場スナップ) も画面固定枠に追従。
   poster 内の img / dual-buffer stage video / snap canvas を全域に。 */
.xc-swipe2 .xc-fs-fake .xc-feed-poster,
.xc-swipe2 .xc-fs-fake .xc-feed-snap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
}
.xc-swipe2 .xc-fs-fake .xc-feed-poster { z-index: 7; }
.xc-swipe2 .xc-fs-fake .xc-feed-poster > img,
.xc-swipe2 .xc-fs-fake .xc-feed-poster > video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* (K) z-index 整合: 背景0 / video1 / snap6 / poster7 / overlay+meta8 / rail9。
   ✕ ボタン (xc-fs-close=10000) と広告/エンドスクリーンは既存の最上位を維持。 */
.xc-swipe2 .xc-fs-fake .xc-feed-meta { z-index: 8; }
.xc-swipe2 .xc-fs-fake .xc-feed-rail { z-index: 9; }

/* (F) 右スワイプ中 (個別ページへ peek): 指追従のみ・opacity は落とさない (閉じと誤認回避)。 */
.xc-swipe2 .xc-detail-peeking > video:not([data-xc-bg]) { will-change: transform; }

/* (J) 右レールを UnratedX (TikTok/Reels) 流に整形。DOM は makeRailBtn/setRailBtn + JS が用意する
   作者アバター (.xc-rail-av)。CSS のみ・全画面 (.xc-fs-fake) 限定 → kill-switch OFF で旧レールに戻る。
   肝: 丸背景なし・drop-shadow で動画に直接 float・塗りつぶし白アイコン・カウントは下・作者アバター最上部。 */
.xc-swipe2 .xc-fs-fake .xc-feed-rail {
    right: calc(8px + env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    width: 60px;
    align-items: center;
    gap: 20px;
}
.xc-swipe2 .xc-fs-fake .xc-rail-btn {
    width: auto;
    min-height: 0;
    padding: 0;
    gap: 5px;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
}
/* 丸背景・blur を撤去してアイコンを動画に直接乗せる (UnratedX の肝) */
.xc-swipe2 .xc-fs-fake .xc-rail-ic {
    width: auto;
    height: auto;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
/* 既定は塗りつぶし白 (UnratedX)。active は下の on-class で色塗り (いいね=ピンク/お気に入り=オレンジ)。 */
.xc-swipe2 .xc-fs-fake .xc-rail-ic svg { width: 34px; height: 34px; fill: #fff; stroke: none; }
.xc-swipe2 .xc-fs-fake .xc-rail-btn.is-active .xc-rail-ic svg { fill: currentColor; }
.xc-swipe2 .xc-fs-fake .xc-rail-n {
    max-width: 56px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
}
/* 作者アバター (レール最上部・丸・白枠・グラデ・頭文字)。UnratedX と同じ見た目。 */
.xc-swipe2 .xc-fs-fake .xc-rail-av {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-sizing: border-box;
    background: linear-gradient(135deg, #7c5cf6 0%, #ec4899 100%);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    text-decoration: none;
    pointer-events: auto;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55));
    -webkit-tap-highlight-color: transparent;
}
.xc-swipe2 .xc-fs-fake .xc-rail-av[hidden] { display: none; }
/* 下部チップのアバターは消す (レール上部のアバターと二重になるため・@handle テキストは残す)。 */
.xc-swipe2 .xc-fs-fake .xc-feed-chip-av { display: none; }
