/* shorts.css — ADR-04 Phase E 視聴 feed UI。
 *
 * フルスクリーン縦動画フィード。レイヤー設計:
 *   z-index 0   #shorts-feed (絶対配置の <video> 群)
 *   z-index 10  各 slot の caption + actions overlay
 *   z-index 20  #shorts-topbar (固定ヘッダ)
 *   z-index 30  #shorts-state  (loading / empty / error 状態 overlay)
 *
 * ローディング時のフリッカ対策で body は黒固定。strict CSP 準拠 (inline 0)。
 */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: #000;
    color: #fff;
    font-family: 'M PLUS Rounded 1c', 'Zen Maru Gothic', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    /* iOS Safari の overscroll bounce を抑止 (フィード swipe と競合する) */
    overscroll-behavior: none;
    height: 100%;
    width: 100%;
}

body {
    /* dynamic viewport (svh/dvh) で iOS の url-bar 出没を吸収。
       未対応ブラウザは vh fallback */
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    /* Disable touch callout/select to keep gestures clean */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#shorts-root {
    position: fixed;
    inset: 0;
    overflow: hidden;
    touch-action: none; /* swipe 物理量を自前で扱うため pinch-to-zoom 等を切る */
    /* PC はマウスで掴んで送れる。掴めることを見た目で示す。 */
    cursor: grab;
    /* ドラッグ中にキャプションや配信者名が範囲選択されると、青い選択矩形が
       付いてきて「掴んでいる」感覚が壊れる。フィードは読み物ではないので切る。 */
    user-select: none;
    -webkit-user-select: none;
}

#shorts-root.is-grabbing {
    cursor: grabbing;
}

/* ボタン類の上では掴む手ではなく通常のポインタに戻す (押せることを示す)。 */
#shorts-root .shorts-action,
#shorts-root .shorts-sound-hint,
#shorts-root .shorts-topbar,
#shorts-root a,
#shorts-root button {
    cursor: pointer;
}

/* ---- Feed slots --------------------------------------------------------- */

#shorts-feed {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/* ---- PC (横長ビューポート) では縦長の枠に収める -------------------------------
 * ⚠ スロットは `inset: 0` で画面全体に広がり、video は `object-fit: cover`。
 *   スマホ (縦長) ではこれで正しいが、PC だと 1280x720 の横長な箱を
 *   縦動画 (204x360) で cover することになり、**上下を大幅に切り抜いた横帯**だけが
 *   見える = 「縦動画が一つも出てこない」ように見える (オーナー報告 2026-08-16)。
 *   → 横長のときだけ 9:16 の列に絞り、左右は背景にする (TikTok / Shorts の PC 表示と同じ)。
 *   スロットの transform は % 指定なので、**親を狭めるだけでスライド量も追従する**
 *   (shorts.js 側の変更は不要)。
 */
@media (min-aspect-ratio: 1 / 1) {
    #shorts-feed {
        left: 50%;
        right: auto;
        width: min(100vw, calc(100dvh * 9 / 16));
        transform: translateX(-50%);
    }
    /* 列の外側は背景。動画と地の境目を軽く示す。 */
    #shorts-feed::before {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    }
}

.shorts-slot {
    position: absolute;
    inset: 0;
    /* translate(x, y) を shorts.js が動的更新
       (current=0,0 / prev=0,-100% / next=0,+100% / left=-100%,0 / right=+100%,0) */
    transform: translate(0, 0);
    will-change: transform;
    background: #000;
}

/* swipe 中は transition 切って物理追従、release で snap 用に短い ease。
   ⚠ 所要時間は shorts.js の SLIDE_MS と **必ず同じ値**にする (ここだけ長いと
   動き終わってから固まり、短いとアニメの途中で中身が切り替わる)。 */
.shorts-slot.is-snapping {
    transition:
        transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1),
        opacity 200ms ease;
}

/* ---- 結び直した直後は透明にしておく (shorts.js: markSlotFresh) --------------
 * ⚠ 役割の回転では、端に居たスロットが **画面の反対側へ瞬間移動する**。
 *   横に 1 手送ると left に居た要素が right になるので 300% 飛び、縦に 1 手
 *   送った後は left / right が y=∓100% から y=0 へ戻る。どちらも中身が別の動画に
 *   差し替わるので、PC のように左右の枠が見えていると **そこだけ絵がパチンと
 *   入れ替わる** = 「一瞬映像が乱れる」(オーナー報告 2026-08-17)。
 *   置き場所が確定するまで透明にし、確定後に短くフェードさせて隠す。
 */
.shorts-slot[data-fresh="true"] {
    opacity: 0;
}

/* 動きを減らす設定の利用者にはスライドを出さない (前庭障害への配慮)。
   送り自体は動くが、瞬間的に切り替わる。
   ⚠ フェードは残す — これは「動き」ではなく差し替えを目立たなくするためのもの。 */
@media (prefers-reduced-motion: reduce) {
    .shorts-slot.is-snapping {
        transition: opacity 200ms ease;
    }
}

.shorts-slot video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

/* Thumb poster fallback for not-yet-loaded videos */
.shorts-slot .shorts-poster {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
}

.shorts-slot .shorts-spinner {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    pointer-events: none;
}

.shorts-slot[data-loading="false"] .shorts-spinner {
    display: none;
}

/* item が割り当てられないスロット (在庫の端) は「読み込み中」ではなく終端。
   loading='false' で隠した spinner を、終端メッセージとして出し直す。 */
.shorts-slot[data-empty="true"] .shorts-spinner {
    display: grid;
    color: rgba(255, 255, 255, 0.55);
}

/* ---- Caption + broadcaster (bottom-left) -------------------------------- */

.shorts-meta {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    padding: 1rem 4.5rem 1.5rem 1rem; /* right padding leaves room for action rail */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none; /* let taps through to <video>, individual children opt back in */
}

.shorts-broadcaster {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    pointer-events: auto;
    margin-bottom: 0.5rem;
}

/* ---- 配信者行は 1 つだけ出す -------------------------------------------------
 * ⚠ left / current / right は **同じ配信者**の別動画なので、アバター・名前・
 *   お気に入りが 3 枚とも同じ。PC では左右の枠が画面に出るため、**同じ名前が
 *   横に 3 つ並んで見えていた** (オーナー報告 2026-08-17)。current の 1 つに絞る。
 *
 *   `visibility` で消す (`display:none` にしない) — 行の高さが残らないと
 *   左右のキャプションだけ下にずれて、送ったときに文字が飛び上がって見える。
 *
 *   横送りの最中は shorts.js (setBroadcasterRowOffset) が current の行を
 *   スロットと逆向きに動かして画面上は据え置く。回転後は隣の行に切り替わるが
 *   中身が同一なので入れ替わりは見えない。
 */
/* 隠す対象は「配信者に紐づく / 全体で 1 つの状態」= 兄弟間で中身が同じもの:
 *   配信者行 (アバター・名前・お気に入り) / チップ行 (次回配信・予告) /
 *   サウンド (soundOn は全体で 1 つ)。
 * ⚠ キャプションと いいね は **動画ごとに違う** ので残す。
 *   (オーナー指示 2026-08-17: 名前 → 次回配信 → お気に入り・サウンド の順に確定) */
/* ⚠ 判定は **列** (data-col) で行う。data-slot を 1 つずつ列挙する形にすると、
 *   3×3 化で四隅 (prevLeft / nextRight …) を足したときに取りこぼす。
 *   c = 中央列 (配信者が違うので各行が自分の名前を持つ) / s = 側列 (同じ配信者)。 */
.shorts-slot[data-col="s"] .shorts-broadcaster,
.shorts-slot[data-col="s"] .shorts-chip-row,
.shorts-slot[data-col="s"] .shorts-action-sound {
    visibility: hidden;
}

/* 四隅は **送っている最中にしか見えない**。終端メッセージ / スピナーを出すと、
   縦に引いた瞬間に「これで終わりです」が斜めから流れ込んでくる。 */
.shorts-slot[data-corner="1"] .shorts-spinner {
    display: none;
}

.shorts-broadcaster.is-snapping,
.shorts-chip-row.is-snapping,
.shorts-action-sound.is-snapping {
    transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    .shorts-broadcaster.is-snapping,
    .shorts-chip-row.is-snapping,
    .shorts-action-sound.is-snapping {
        transition: none;
    }
}

/* ADR-06 ①: アバターはプロフィールへのリンク。配信中は LIVE リング + 小札。 */
.shorts-avatar-link {
    position: relative;
    display: block;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}

.shorts-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #444;
    overflow: hidden;
    flex-shrink: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    box-sizing: border-box;
}

.shorts-avatar.is-live {
    border-color: #ff2d55;
    box-shadow: 0 0 0 2px rgba(255, 45, 85, 0.85), 0 0 12px rgba(255, 45, 85, 0.6);
}

.shorts-avatar-live {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    padding: 0 5px;
    border-radius: 6px;
    background: #ff2d55;
    color: #fff;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.shorts-avatar-live[hidden] {
    display: none;
}

.shorts-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.shorts-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
}

.shorts-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    /* clamp long display names */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 48vw;
    color: #fff;
    text-decoration: none;
}

.shorts-name:hover {
    text-decoration: underline;
}

/* 代表ショートの小札 */
.shorts-pin-badge {
    padding: 0 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.6;
    text-shadow: none;
}

.shorts-pin-badge[hidden] {
    display: none;
}

/* 「配信中 · N人が視聴中」ピル → /watch */
.shorts-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #ff2d55;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    animation: shorts-live-pulse 1.8s ease-in-out infinite;
}

.shorts-live-pill[hidden] {
    display: none;
}

.shorts-live-pill:active {
    transform: scale(0.96);
}

@keyframes shorts-live-pulse {
    0%, 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 45, 85, 0.55); }
    50% { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(255, 45, 85, 0); }
}

/* お気に入り (配信者に対して) — like (♥、ショートに対して) とは別物なので ★ */
.shorts-fav {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    text-shadow: none;
}

.shorts-fav.is-on {
    background: rgba(255, 210, 60, 0.92);
    border-color: rgba(255, 210, 60, 0.92);
    color: #3a2a00;
}

.shorts-fav:active {
    transform: scale(0.96);
}

.shorts-fav-icon {
    display: inline-grid;
    place-items: center;
}

/* 予告 / 次回配信のチップ → プロフィールのスケジュール */
.shorts-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    pointer-events: none;
}

.shorts-chip {
    display: inline-block;
    max-width: 100%;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.shorts-chip.is-trailer {
    background: rgba(120, 60, 200, 0.75);
    border-color: rgba(200, 160, 255, 0.5);
}

.shorts-chip[hidden] {
    display: none;
}

/* 横ローテーションの位置 (同じ配信者の動画 2 / 5) */
.shorts-hpos {
    margin-top: 0.4rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    font-variant-numeric: tabular-nums;
}

.shorts-hpos[hidden] {
    display: none;
}

/* 横スワイプの初回ヒント (画面中央やや下、数秒で消える) */
.shorts-hswipe-hint {
    position: absolute;
    left: 50%;
    top: 62%;
    z-index: 12;
    transform: translateX(-50%);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
    animation: shorts-hswipe-hint-in 320ms ease-out;
}

.shorts-hswipe-hint[hidden] {
    display: none;
}

@keyframes shorts-hswipe-hint-in {
    from { transform: translate(-50%, 6px); }
    to   { transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .shorts-hswipe-hint { animation: none; }
    .shorts-live-pill { animation: none; }
}

.shorts-caption {
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    -webkit-user-select: text;
    user-select: text;
    /* 3 行で切る */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* ---- Action rail (right side) ------------------------------------------ */

.shorts-actions {
    position: absolute;
    right: 0.5rem;
    bottom: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding-right: 0.25rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0));
    pointer-events: auto;
}

.shorts-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    font: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.shorts-action:active {
    transform: scale(0.92);
}

.shorts-action-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 50%;
}

.shorts-action.is-liked .shorts-action-icon {
    background: rgba(255, 64, 129, 0.95);
}

.shorts-action-count {
    font-size: 0.78rem;
    font-weight: 600;
    min-height: 1em;
}

/* ---- 音声 ON/OFF (v0.9.2.n) -------------------------------------------
   ブラウザ要件で最初の再生は必ず muted になる。**解除する導線が無いと
   shorts は永久に無音** なので、いいねの下に常設する。
   ミュート中は少し目立たせて「音を出せる」ことに気づけるようにする。 */
.shorts-action-sound.is-muted .shorts-action-icon {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

/* 指が届く最小サイズを確保 (アイコンは 36px だが当たり判定は padding 込み) */
.shorts-action-sound {
    min-width: 44px;
    min-height: 44px;
}

/* ---- 初回ヒント --------------------------------------------------------
   アイコンの強調だけでは気づかれない。この機能は音ありきなので、無音のまま
   見続けられるのが最大の失敗。一度でも音声を操作したら以後は出さない。 */
.shorts-sound-hint {
    position: absolute;
    right: 0.5rem;
    /* アクションレールの上端あたり。safe-area を跨がないよう bottom 基準。 */
    bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 11;
    max-width: 60vw;
    padding: 0.4rem 0.75rem;
    border: 0;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #fff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(4px);
    /* ⚠ opacity は animate しない。ヒントは装飾ではなく「音が出せる」ことを
       伝える機能要素で、アニメーションが進まない状況 (バックグラウンドタブ、
       省電力、compositing されていない環境) では `from` の opacity:0 のまま
       張り付いて **見えなくなる**。動かすのは transform だけにする。 */
    animation: shorts-sound-hint-in 240ms ease-out;
}

.shorts-sound-hint::before {
    content: '🔇';
    margin-right: 0.35rem;
}

.shorts-sound-hint:active {
    transform: scale(0.94);
}

@keyframes shorts-sound-hint-in {
    from { transform: translateY(6px); }
    to   { transform: translateY(0); }
}

/* 動きを減らす設定を尊重する (a11y)。表示自体は残す — これは装飾ではなく
   「音が出せる」ことを伝える機能的な要素なので、消してはいけない。 */
@media (prefers-reduced-motion: reduce) {
    .shorts-sound-hint { animation: none; }
    .shorts-sound-hint:active { transform: none; }
}

/* ---- Tap-to-play / pause indicator (transient) ------------------------- */

.shorts-tap-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 10;
    transform: translate(-50%, -50%) scale(0.6);
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    color: #fff;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease-out, transform 200ms ease-out;
}

.shorts-tap-indicator.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Double-tap heart burst */
.shorts-heart-burst {
    position: absolute;
    z-index: 11;
    pointer-events: none;
    font-size: 4rem;
    color: #ff4081;
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
    animation: shorts-heart-burst 700ms ease-out forwards;
}

@keyframes shorts-heart-burst {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
    20% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(2.2); }
}

/* ---- Top bar ----------------------------------------------------------- */

#shorts-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    padding-top: calc(0.5rem + env(safe-area-inset-top, 0));
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
}

#shorts-topbar > * {
    pointer-events: auto;
}

.shorts-back {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.25);
}

.shorts-title {
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* 配信者単位モード: 「◯◯ のショート」(→ プロフィール) と「すべて」(→ /shorts) */
.shorts-filter,
.shorts-filter-all {
    font-size: 0.8rem;
    color: #fff;
    text-decoration: none;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.shorts-filter[hidden],
.shorts-filter-all[hidden] {
    display: none;
}

.shorts-filter-all {
    background: rgba(255, 255, 255, 0.22);
}

/* ---- ⑤ ライブプレビュー小窓 (右上、トップバーの下) ----------------------
   現在の短編の配信者が配信中なら muted の LL-HLS を流す。タップで /watch。
   映像は縦動画に重なるので、小さく・角丸で・境界をはっきりさせる。 */
.shorts-live-preview {
    position: fixed;
    top: calc(3.25rem + env(safe-area-inset-top, 0));
    right: 0.6rem;
    z-index: 15;
    width: 34vw;
    max-width: 200px;
    min-width: 120px;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(255, 45, 85, 0.9);
    display: block;
}

.shorts-live-preview[hidden] {
    display: none;
}

.shorts-live-preview video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #111;
    /* 再生が始まるまでは見せない (静止カードの文字と重ならないように) */
    opacity: 0;
    transition: opacity 240ms ease-out;
}

.shorts-live-preview.is-playing video {
    opacity: 1;
}

.shorts-live-preview-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 0 6px;
    border-radius: 6px;
    background: #ff2d55;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.6;
}

.shorts-live-preview-label {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 22px;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shorts-live-preview-cta {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 5px;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* 何本目 / 全体。**画面には出さない** (オーナー指示 2026-08-17:
   「ショート動画の右上の数字表示はいらない」)。
   2026-08-14 に「フルスクリーンで 1 本ずつしか見えず、他に動画があるのか
   分からない」という指摘で足したものだが、その後 PC で左右の動画が見える
   ようになった (v0.9.2.cn / 0.9.3.d の 3×3) ので、続きがあることは画面から
   直接分かる。

   ⚠ **要素ごと消さない。** aria-live で送るたびに位置を読み上げているので、
     見える表示だけを消すと**画面を見ない利用者だけが位置を失う**。
     ここで視覚的に隠し、読み上げは残す。
     (検査 2 本が内部状態の読み取り口としても使っている — shorts.html 参照)
   ⚠ `display:none` / `visibility:hidden` にすると **読み上げも止まる**。
     支援技術に読ませたまま隠すには clip / clip-path を使う。 */
.shorts-position {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---- State overlay (loading / empty / error) --------------------------- */

.shorts-state {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    background: #000;
    text-align: center;
    padding: 2rem;
    pointer-events: auto;
}

.shorts-state[data-state="hidden"] {
    display: none;
}

.shorts-state-msg {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

.shorts-state-btn {
    appearance: none;
    border: 0;
    background: #ff4081;
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: 999px;
    cursor: pointer;
}

.shorts-state-btn[hidden] {
    display: none;
}
