/* ============================================================
   AVFlip  スタイルシート
   縦型ショート動画 UI（独自デザイン）
   ------------------------------------------------------------
   ・黒背景 ＋ 全画面縦動画 ＋ 右側アクション ＋ 左下情報 ＋ 下部ナビ
     という一般的なショート動画アプリのレイアウト構造を採用。
   ・ロゴ・アイコン・配色はすべて AVFlip 独自のもの。
     他社サービスのロゴ／商標／固有アイコン／固有配色は使用しない。
   ・アクセントはマゼンタレッド 1 色のみ（管理画面から変更可）。
   ・モバイルファースト。390px 幅を最優先。
   ============================================================ */

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg, video { max-width: 100%; display: block; }
/* インライン SVG アイコンの既定サイズ（各コンポーネント側の指定が後勝ちで上書き） */
svg { width: 1.1em; height: 1.1em; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- デザイントークン ---------- */
:root {
  /* 背景・面 */
  --bg:        #000;
  --bg-1:      #111;
  --bg-2:      #1a1a1a;
  --bg-3:      #242424;
  --line:      #262626;
  --line-soft: #1c1c1c;

  /* 文字 */
  --text:   #fff;
  --text-2: #aaa;
  --text-3: #6f6f6f;

  /* アクセント（AVFlip 独自：マゼンタレッド 1 色）
     ※ --accent-2 は同系統の濃色。別色ではなくグラデーション用の陰影。 */
  --accent:     #ff2b6d;
  --accent-2:   #c4104a;
  --accent-ink: #fff;

  --danger:  #ff4d5e;
  --success: #35d08a;
  --info:    #58a6ff;

  --radius-sm:   10px;
  --radius:      14px;
  --radius-lg:   20px;
  --radius-pill: 999px;

  --nav-h:    54px;
  --header-h: 50px;
  --rail-w:   62px;
  --side-w:   216px;
  --feed-w:   468px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(.22, .8, .3, 1);
  --dur:  170ms;

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
          -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI",
          Meiryo, system-ui, sans-serif;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: .01em;
  min-height: 100vh;
  min-height: 100svh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  /* 横スクロール禁止 */
  overflow-x: hidden;
  max-width: 100%;
}

/* フィードなど画面全体を占有する画面ではページ自体をスクロールさせない */
body.is-fullbleed {
  overflow: hidden;
  height: 100vh;
  height: 100svh;
}

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* 目立たないスクロールバー */
* { scrollbar-width: thin; scrollbar-color: #333 transparent; }
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-thumb { background: #2c2c2c; border-radius: 3px; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   ロゴ
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.brand__mark {
  width: 24px; height: 24px; border-radius: 8px;
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-2) 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 13px; font-weight: 800; line-height: 1;
  box-shadow: 0 0 0 1px rgba(255,255,255,.10) inset;
}
.brand__name { font-size: 16px; letter-spacing: .04em; }

/* ============================================================
   ホーム：縦型フィード
   ============================================================ */
.feed {
  height: 100vh;
  height: 100svh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: var(--bg);
}
.feed::-webkit-scrollbar { width: 0; height: 0; }

/* 1 投稿 = 1 画面 */
.video-slide,
.slide {
  position: relative;
  height: 100vh;
  height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

/* 動画本体（余白は黒のまま。白いカードや太い枠線は使わない） */
.slide__media {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-t) + 52px) 0 calc(var(--nav-h) + var(--safe-b) + 8px);
}

.embed-box {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  background: transparent;
}
.embed-box::-webkit-scrollbar { width: 0; }
.embed-box .twitter-tweet { margin: 0 auto !important; }
/* 埋め込みが読めなかった場合でもレイアウトを崩さない */
.embed-box > * { max-width: 100%; }

/* 読み込み中表示 */
.embed-skeleton {
  width: min(100%, 440px);
  margin-inline: auto;
  aspect-ratio: 9 / 15;
  max-height: 100%;
  border-radius: var(--radius);
  background: linear-gradient(100deg, #0d0d0d 30%, #191919 50%, #0d0d0d 70%);
  background-size: 300% 100%;
  animation: shimmer 1.5s linear infinite;
  display: grid;
  place-items: center;
}
.embed-skeleton span {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.12);
  border-top-color: var(--accent);
  animation: spin .85s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* 埋め込み失敗時 */
.embed-fallback {
  width: min(100%, 440px); margin-inline: auto;
  aspect-ratio: 9 / 15; max-height: 100%;
  border-radius: var(--radius);
  background: var(--bg-1);
  display: grid; place-items: center; text-align: center; padding: 24px;
}
.embed-fallback a { color: var(--accent); font-size: 14px; font-weight: 600; }

/* ---------- 上部オーバーレイ（フィードタブ） ---------- */
.feed-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  padding: calc(var(--safe-t) + 10px) 12px 22px;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 55%, rgba(0,0,0,0) 100%);
  pointer-events: none;
}
.feed-top > * { pointer-events: auto; }
.feed-top .brand__name { font-size: 15px; }
.feed-top__spacer { flex: 1; }

/* おすすめ｜最新 */
.feedtabs {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
}
.feedtabs a {
  position: relative;
  font-size: 15px; font-weight: 600; color: rgba(255,255,255,.62);
  padding: 2px 2px 7px;
  transition: color var(--dur) var(--ease);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  white-space: nowrap;
}
.feedtabs a[aria-current="true"] { color: #fff; }
.feedtabs a[aria-current="true"]::after {
  content: "";
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 20px; height: 2.5px; border-radius: 2px;
  background: var(--accent);
}
.feedtabs__sep { color: rgba(255,255,255,.28); font-size: 13px; padding-bottom: 7px; }

.iconbtn {
  width: 40px; height: 40px; min-width: 40px;
  display: grid; place-items: center;
  border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
}
.iconbtn svg { width: 22px; height: 22px; }
.iconbtn:active { transform: scale(.92); }

/* ---------- 右側アクションレール ---------- */
.rail {
  position: absolute; right: 6px; z-index: 6;
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: var(--rail-w);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.rail__avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff; font-weight: 800; font-size: 17px;
  border: 2px solid rgba(255,255,255,.9);
  margin-bottom: 2px;
}

.rail__btn {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #fff; padding: 0;
  /* タップ領域 44px 以上を確保 */
  min-width: 48px; min-height: 48px;
  justify-content: center;
}
.rail__icon {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.rail__btn svg {
  width: 25px; height: 25px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.6));
}
.rail__count {
  font-size: 11.5px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.75);
  font-variant-numeric: tabular-nums;
}
.rail__btn:active .rail__icon { transform: scale(.9); }

/* いいね：ON でアクセント色に */
.rail__btn.is-on[data-action="like"] svg { fill: var(--accent); stroke: var(--accent); }
/* 保存：ON で白塗り */
.rail__btn.is-on[data-action="bookmark"] svg { fill: #fff; stroke: #fff; }

/* いいね：小さく scale / 保存：軽い bounce */
@keyframes pop    { 0% { transform: scale(1); } 45% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes bounce { 0% { transform: translateY(0); } 35% { transform: translateY(-6px); } 65% { transform: translateY(1px); } 100% { transform: translateY(0); } }
.rail__btn.is-pop[data-action="like"] .rail__icon     { animation: pop .28s var(--ease); }
.rail__btn.is-pop[data-action="bookmark"] .rail__icon { animation: bounce .34s var(--ease); }

/* ---------- 左下の投稿情報 ---------- */
.slide__meta {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 64px 14px calc(var(--nav-h) + var(--safe-b) + 14px);
  padding-right: calc(var(--rail-w) + 14px);
  /* 下から上への黒グラデーションで可読性を確保 */
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 45%, rgba(0,0,0,.75) 100%);
  pointer-events: none;
}
.slide__meta > * { pointer-events: auto; }
.slide__meta a { color: inherit; }

.slide__author {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  margin-bottom: 6px;
}
.slide__title {
  font-size: 14.5px; font-weight: 600; line-height: 1.5; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.slide__desc {
  margin-top: 4px;
  font-size: 13px; line-height: 1.55; color: rgba(255,255,255,.82);
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.slide__tags {
  margin-top: 7px;
  display: flex; flex-wrap: wrap; gap: 5px 10px;
  font-size: 13px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.slide__tags a:active { opacity: .6; }
.slide__sub {
  margin-top: 7px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font-size: 11.5px; color: rgba(255,255,255,.62);
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
}
.slide__sub span { display: inline-flex; align-items: center; gap: 4px; }
.slide__sub svg { width: 13px; height: 13px; }

/* ---------- フィード内広告スライド ---------- */
.slide--ad {
  flex-direction: column; justify-content: center; align-items: center;
  padding: calc(var(--safe-t) + 60px) 16px calc(var(--nav-h) + var(--safe-b) + 20px);
}
.slide--ad .ad-slot { width: 100%; max-width: 440px; }

/* ---------- フィードの末尾／空 ---------- */
.feed__loader {
  height: 88px; display: grid; place-items: center;
  color: var(--text-3); font-size: 12.5px;
  scroll-snap-align: end;
}
.feed__empty {
  height: 100vh; height: 100svh;
  display: grid; place-items: center; text-align: center; padding: 30px;
}

/* ============================================================
   下部固定ナビゲーション（スマホ）
   ============================================================ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10px; font-weight: 500;
  color: var(--text-3);
  min-width: 0; overflow: hidden;
  transition: color var(--dur) var(--ease);
}
.tabbar a span:last-child { white-space: nowrap; max-width: 100%; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: #fff; }

/* 中央の「投稿」だけ控えめに強調（角丸の縦長プレート） */
.tab-post__fab {
  width: 34px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 2px 10px rgba(255,43,109,.32);
}
.tab-post__fab svg { width: 17px; height: 17px; stroke-width: 2.4; }

/* ============================================================
   PC 専用カラム（狭い画面では非表示）
   ※ display の既定値はメディアクエリより前に置くこと。
      後ろに置くと同一詳細度で後勝ちになり、メディアクエリが効かなくなる。
   ============================================================ */
.sidenav   { display: none; }
.rightrail { display: none; }

/* ============================================================
   通常ページ（ランキング・検索・投稿 など）
   ============================================================ */
.page {
  min-height: 100vh; min-height: 100svh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 20px);
}
.container { width: 100%; max-width: 720px; margin-inline: auto; padding-inline: 14px; }

/* 通常ページのヘッダー */
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  height: calc(var(--header-h) + var(--safe-t));
  padding: var(--safe-t) 10px 0;
  background: rgba(0,0,0,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.appbar__title { font-size: 16px; font-weight: 700; }
.appbar__spacer { flex: 1; }
/* 戻る／検索などの丸ボタン（.iconbtn と同等） */
.appbar__action {
  width: 40px; height: 40px; min-width: 40px;
  display: grid; place-items: center;
  border-radius: 50%; border: 0; cursor: pointer;
  background: transparent; color: #fff;
}
.appbar__action svg { width: 22px; height: 22px; }
.appbar__action:active { transform: scale(.92); }

/* 動画詳細のタグ列 */
.slide__chips { display: flex; flex-wrap: wrap; gap: 7px; }

/* 年齢確認・閲覧不可ページの 18+ バッジ */
.gate__badge {
  display: inline-grid; place-items: center;
  width: 58px; height: 58px; border-radius: 50%;
  border: 2px solid var(--accent); color: var(--accent);
  font-weight: 800; font-size: 17px; margin: 14px auto 10px;
}

.page__title { font-size: 20px; font-weight: 700; margin: 18px 0 4px; }
.page__lead { color: var(--text-2); font-size: 13px; line-height: 1.7; margin-bottom: 14px; }

.section { margin-top: 22px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section__title { font-size: 16px; font-weight: 700; }
.section__title::before {
  content: ""; display: inline-block; width: 3px; height: 14px;
  background: var(--accent); border-radius: 2px;
  margin-right: 8px; transform: translateY(2px);
}

/* 横スクロールタブ */
.scroll-tabs {
  display: flex; gap: 20px; overflow-x: auto;
  padding: 12px 14px 0; margin-inline: -14px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.scroll-tabs::-webkit-scrollbar { height: 0; }
.scroll-tabs a {
  position: relative; flex: none;
  padding-bottom: 9px;
  font-size: 14.5px; font-weight: 600; color: var(--text-3);
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.scroll-tabs a[aria-current="true"], .scroll-tabs a.is-active { color: #fff; }
.scroll-tabs a[aria-current="true"]::after, .scroll-tabs a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2.5px; border-radius: 2px; background: var(--accent);
}
.scroll-tabs--bordered { border-bottom: 1px solid var(--line-soft); }

/* チップ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.chip--accent { border-color: rgba(255,43,109,.45); color: var(--accent); background: rgba(255,43,109,.10); }
.chip.is-active, .chip[aria-current="true"] { background: #fff; color: #000; border-color: #fff; font-weight: 600; }
.scroller { display: flex; gap: 8px; overflow-x: auto; padding: 2px 14px 8px; margin-inline: -14px; scrollbar-width: none; }
.scroller::-webkit-scrollbar { height: 0; }

/* ============================================================
   サムネイル（共通）
   ============================================================ */
.thumb {
  position: relative; width: 100%; aspect-ratio: 9 / 14;
  overflow: hidden; background: var(--bg-1);
  display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__ph {
  color: #333; font-size: 10px; letter-spacing: .16em; font-weight: 700;
}
/* サムネ下部の統計（グリッド用） */
.thumb__stats {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 8px 7px;
  display: flex; gap: 10px; align-items: center;
  font-size: 11px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.8));
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  opacity: 1;
  transition: opacity var(--dur) var(--ease);
}
.thumb__stats span { display: inline-flex; align-items: center; gap: 3px; }
.thumb__stats svg { width: 13px; height: 13px; }

/* ============================================================
   3 列グリッド（保存・マイページ）
   ============================================================ */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-inline: -14px;
}
.grid-3 .gcell { position: relative; display: block; background: var(--bg-1); }
.grid-3 .gcell .thumb { aspect-ratio: 9 / 15; }

/* サムネ下部：タイトルと統計を縦に重ねる（互いに重ならないように） */
.gcell__foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: 22px 6px 6px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.88));
  pointer-events: none;
}
.gcell__title {
  font-size: 10.5px; line-height: 1.35; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
}
.gcell__stats {
  display: flex; gap: 9px; align-items: center;
  font-size: 10.5px; font-weight: 600; color: rgba(255,255,255,.9);
  text-shadow: 0 1px 3px rgba(0,0,0,.9);
  transition: opacity var(--dur) var(--ease);
}
.gcell__stats > span { display: inline-flex; align-items: center; gap: 3px; }
.gcell__stats svg { width: 12px; height: 12px; }

/* 2 列カード（検索結果など） */
.grid-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.vcard { background: var(--bg-1); border-radius: var(--radius); overflow: hidden; position: relative; }
.vcard .thumb { border-radius: 0; }
.vcard__body { padding: 8px 9px 10px; }
.vcard__title {
  font-size: 12.5px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vcard__stats { margin-top: 5px; font-size: 11px; color: var(--text-3); display: flex; gap: 10px; }

/* ============================================================
   ランキング
   ============================================================ */
.rank-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.rank-card {
  display: grid; grid-template-columns: 40px 76px 1fr; gap: 10px; align-items: center;
  background: var(--bg-1); border-radius: var(--radius);
  padding: 8px; overflow: hidden;
  transition: transform 120ms var(--ease), background var(--dur) var(--ease);
}
.rank-card:active { transform: scale(.99); background: var(--bg-2); }
.rank-card .thumb { border-radius: 10px; aspect-ratio: 9 / 13; }

.rank-card__no {
  font-size: 17px; font-weight: 800; text-align: center;
  font-variant-numeric: tabular-nums; color: var(--text-3);
}
/* 1〜3 位は順位バッジを大きく */
.rank-card--top .rank-card__no {
  width: 34px; height: 34px; margin-inline: auto;
  display: grid; place-items: center; border-radius: 11px;
  font-size: 19px; color: #fff;
}
.rank-card--top1 .rank-card__no { background: linear-gradient(145deg, var(--accent), var(--accent-2)); box-shadow: 0 3px 12px rgba(255,43,109,.4); }
.rank-card--top2 .rank-card__no { background: #3a3a3a; }
.rank-card--top3 .rank-card__no { background: #2a2a2a; color: var(--text-2); }
.rank-card--top1 { background: #150a10; box-shadow: inset 0 0 0 1px rgba(255,43,109,.28); }

.rank-card__body { min-width: 0; }
.rank-card__title {
  font-size: 13.5px; font-weight: 600; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rank-card__stats {
  margin-top: 5px; display: flex; flex-wrap: wrap; gap: 3px 11px;
  font-size: 11px; color: var(--text-3);
}
.rank-card__stats span { display: inline-flex; align-items: center; gap: 4px; }
.rank-card__stats svg { width: 12.5px; height: 12.5px; }

/* ============================================================
   マイページ
   ============================================================ */
.profile { text-align: center; padding: 22px 14px 6px; }
.profile__avatar {
  width: 82px; height: 82px; border-radius: 50%; margin: 0 auto 10px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 32px; font-weight: 800;
}
.profile__name { font-size: 17px; font-weight: 700; }
.profile__sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.profile__stats {
  display: flex; justify-content: center; gap: 30px; margin-top: 16px;
}
.profile__stat { text-align: center; }
.profile__stat b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile__stat span { font-size: 11.5px; color: var(--text-3); }
.profile__actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }

/* タブ（JS で切替） */
.pill-tabs {
  display: flex; border-bottom: 1px solid var(--line-soft); margin-top: 18px;
}
.pill-tabs button {
  flex: 1; appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 11px 0; font-size: 13.5px; font-weight: 600; color: var(--text-3);
  position: relative; transition: color var(--dur) var(--ease);
}
.pill-tabs button[aria-selected="true"] { color: #fff; }
.pill-tabs button[aria-selected="true"]::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px;
  height: 2.5px; border-radius: 2px; background: var(--accent);
}
.tabpanel[hidden] { display: none; }

/* ============================================================
   動画詳細
   ============================================================ */
.detail__embed { background: var(--bg); padding: 8px 0; margin-top: 8px; }
.detail__title { font-size: 17px; font-weight: 700; line-height: 1.45; margin-top: 14px; }
.detail__meta { margin-top: 8px; font-size: 12px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.detail__meta span { display: inline-flex; align-items: center; gap: 4px; }
.detail__desc { margin-top: 14px; font-size: 14px; color: var(--text-2); line-height: 1.8; word-break: break-word; }
.detail__desc a { color: var(--accent); text-decoration: underline; }
.detail__actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.actionbtn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 15px; border-radius: var(--radius-pill);
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: 13px; font-weight: 600;
}
.actionbtn svg { width: 17px; height: 17px; }
.actionbtn.is-on { border-color: var(--accent); color: var(--accent); background: rgba(255,43,109,.10); }
.actionbtn.is-on svg { fill: var(--accent); }
.actionbtn:active { transform: scale(.97); }

/* ============================================================
   フォーム
   ============================================================ */
.form { display: flex; flex-direction: column; gap: 15px; margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field__label .req { color: var(--accent); font-size: 11px; margin-left: 5px; }
.field__hint { font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.field__error { font-size: 12px; color: var(--danger); }

.input, .textarea, .select {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px;
  color: var(--text);
  font-size: 16px; /* iOS の自動ズーム防止 */
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); background: var(--bg-2); outline: none;
}
.input::placeholder, .textarea::placeholder { color: #555; }
.textarea { min-height: 104px; resize: vertical; line-height: 1.7; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px;
  padding-right: 38px;
}
.field--error .input, .field--error .textarea, .field--error .select { border-color: var(--danger); }

/* 投稿画面のメイン URL 入力 */
.url-field .input {
  font-size: 16px; padding: 16px 14px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.url-field .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,43,109,.14); }
.url-field .field__label { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 2px; }

.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin-top: 1px; }

.btn {
  appearance: none; cursor: pointer; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 700;
  background: var(--bg-3); color: var(--text);
  transition: filter var(--dur) var(--ease), transform 110ms var(--ease);
}
.btn:active { transform: scale(.98); }
.btn--primary {
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,43,109,.28);
}
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.btn--danger { background: rgba(255,77,94,.12); color: var(--danger); border: 1px solid rgba(255,77,94,.4); }
.btn--block { width: 100%; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn--lg { min-height: 52px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* 投稿画面の下部固定送信バー */
.submit-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b));
  padding: 12px 0 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0), var(--bg) 30%);
}

/* ============================================================
   通知・カード・その他
   ============================================================ */
.alert {
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13px;
  border: 1px solid var(--line); background: var(--bg-1); line-height: 1.7;
  margin-top: 14px;
}
.alert--error   { border-color: rgba(255,77,94,.42);  background: rgba(255,77,94,.08);  color: #ffb3b9; }
.alert--success { border-color: rgba(53,208,138,.42); background: rgba(53,208,138,.08); color: #9deec8; }
.alert--info    { border-color: rgba(88,166,255,.42); background: rgba(88,166,255,.08); color: #b8d9ff; }
.alert--warn    { border-color: rgba(255,43,109,.40); background: rgba(255,43,109,.08); color: #ffc2d3; }

.card { background: var(--bg-1); border-radius: var(--radius); padding: 15px; }
.card + .card { margin-top: 10px; }

.empty { text-align: center; padding: 54px 20px; color: var(--text-3); }
.empty__icon { font-size: 30px; opacity: .4; margin-bottom: 10px; }
.empty__icon svg { width: 34px; height: 34px; margin-inline: auto; }

.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--line-soft);
  font-size: 14px; min-height: 48px;
}
.list-row:last-child { border-bottom: 0; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.list-row__sub span { display: inline-flex; align-items: center; gap: 4px; }
.list-row__arrow { color: var(--text-3); }

.badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; }
.badge--published { background: rgba(53,208,138,.16); color: var(--success); }
.badge--pending   { background: rgba(255,43,109,.16); color: var(--accent); }
.badge--private   { background: rgba(255,255,255,.09); color: var(--text-2); }
.badge--rejected  { background: rgba(255,77,94,.16);  color: var(--danger); }
.badge--open      { background: rgba(255,77,94,.16);  color: var(--danger); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--bg-1); border-radius: var(--radius); padding: 13px; }
.stat__label { font-size: 11.5px; color: var(--text-3); }
.stat__value { font-size: 22px; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ============================================================
   広告枠
   ============================================================ */
.ad-slot {
  position: relative; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 12px 12px;
  margin: 14px 0; background: var(--bg-1); overflow: hidden;
}
.ad-label { position: absolute; top: 6px; left: 10px; font-size: 10px; letter-spacing: .14em; color: var(--text-3); }
.slide--ad .ad-label { position: static; display: block; margin-bottom: 10px; }
.ad-body { max-width: 100%; overflow-x: auto; }

.interstitial {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.9);
  display: grid; place-items: center; padding: 18px;
  backdrop-filter: blur(5px);
}
.interstitial[hidden] { display: none; }
.interstitial__panel {
  width: 100%; max-width: 440px;
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
}
.interstitial__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2);
}
.interstitial__bar .ad-label { position: static; }
.interstitial__close {
  appearance: none; cursor: pointer;
  min-width: 92px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--bg-3); border: 1px solid var(--line);
  color: var(--text); font-size: 14px; font-weight: 700;
}
.interstitial__body { padding: 16px; min-height: 110px; }

/* ============================================================
   ボトムシート（下から slide）
   ============================================================ */
.sheet {
  position: fixed; inset: 0; z-index: 150;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.65);
  animation: fade .16s var(--ease);
}
.sheet[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet__panel {
  width: 100%; max-width: 520px;
  background: var(--bg-1); border: 1px solid var(--line); border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
  animation: slideUp .22s var(--ease);
  max-height: 88vh; max-height: 88svh; overflow-y: auto;
}
.sheet__grip { width: 36px; height: 4px; border-radius: 3px; background: #333; margin: -6px auto 14px; }
.sheet__title { font-size: 16px; font-weight: 700; text-align: center; }
.sheet__text { font-size: 13px; color: var(--text-2); text-align: center; margin-top: 8px; line-height: 1.7; }
.sheet__actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

/* 保存 5 件以上のときだけ出る任意の案内（強制ではない・閉じられる） */
.guest-hint {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  z-index: 140;
  width: calc(100% - 24px); max-width: 460px;
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 40px 12px 14px;
  animation: slideUp .22s var(--ease);
}
.guest-hint__text { font-size: 12.5px; line-height: 1.55; color: var(--text-2); flex: 1; }
.guest-hint__actions { flex: none; }
.guest-hint__close {
  position: absolute; top: 4px; right: 4px;
  width: 32px; height: 32px; display: grid; place-items: center;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  color: var(--text-3); font-size: 14px; line-height: 1;
}
@media (min-width: 1024px) { .guest-hint { bottom: 22px; } }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  z-index: 300;
  background: rgba(30,30,30,.97); color: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  padding: 11px 20px; font-size: 13px;
  animation: slideUp .18s var(--ease);
  max-width: calc(100% - 32px); text-align: center;
}

/* ============================================================
   年齢確認（落ち着いた全面黒）
   ============================================================ */
.gate {
  min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center;
  padding: 28px 22px calc(28px + var(--safe-b));
  background: var(--bg);
}
.gate__box { width: 100%; max-width: 380px; text-align: center; }
.gate__mark {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 17px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 24px;
}
.gate__title { font-size: 24px; font-weight: 800; letter-spacing: .05em; }
.gate__age { font-size: 12px; color: var(--accent); font-weight: 700; letter-spacing: .18em; margin-top: 8px; }
.gate__lead { font-size: 14px; color: var(--text); margin-top: 22px; line-height: 1.8; }
.gate__text { font-size: 12.5px; color: var(--text-3); line-height: 1.85; margin-top: 12px; }
.gate__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.gate__links { margin-top: 22px; font-size: 11.5px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.gate__links a:hover { color: var(--text-2); }

/* ============================================================
   フッター
   ============================================================ */
.footer {
  margin-top: 32px; padding: 22px 14px calc(24px + var(--nav-h) + var(--safe-b));
  border-top: 1px solid var(--line-soft);
  color: var(--text-3); font-size: 12px;
}
.footer__links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 14px; }
.footer__links a { color: var(--text-2); }
.footer__links a:hover { color: var(--accent); }
.footer__note { line-height: 1.9; }
.footer__note strong { color: var(--text-2); }

/* ============================================================
   本文（法務ページ）
   ============================================================ */
.prose { font-size: 14px; line-height: 1.95; color: var(--text-2); }
.prose h2 { font-size: 15.5px; color: var(--text); margin: 26px 0 8px; font-weight: 700; }
.prose h3 { font-size: 14.5px; color: var(--text); margin: 18px 0 6px; font-weight: 700; }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin: 0 0 12px 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 5px; }
.prose a { color: var(--accent); text-decoration: underline; }
.prose strong { color: var(--text); }
.prose hr { border: 0; border-top: 1px solid var(--line-soft); margin: 22px 0; }

/* ============================================================
   タブレット
   ============================================================ */
@media (min-width: 700px) {
  .grid-cards { grid-template-columns: repeat(3, 1fr); }
  .stat-grid  { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================
   PC：3 カラム（左サイドナビ / 中央フィード / 右ランキング）
   1024px 未満ではスマホ UI のまま
   ============================================================ */
@media (min-width: 1024px) {
  /* サイドナビ／右カラムを描画しない画面（年齢確認・閲覧不可・管理画面＝.is-bare）には
     この余白を付けない。付けるとカードが中央からずれ、内容が切れる。 */
  body:not(.is-bare) { padding-left: var(--side-w); }
  body.is-fullbleed { overflow: hidden; }

  /* 下部ナビを隠して左サイドナビへ */
  .tabbar { display: none; }

  .sidenav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: var(--side-w);
    display: flex; flex-direction: column; gap: 4px;
    padding: 18px 12px;
    background: var(--bg);
    border-right: 1px solid var(--line-soft);
    overflow-y: auto;
  }
  .sidenav__brand { display: flex; align-items: center; gap: 8px; padding: 6px 10px 18px; }
  .sidenav__brand .brand__name { font-size: 18px; }
  .sidenav a.sidenav__item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border-radius: var(--radius);
    font-size: 14.5px; font-weight: 600; color: var(--text-2);
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  }
  .sidenav a.sidenav__item svg { width: 22px; height: 22px; }
  .sidenav a.sidenav__item:hover { background: var(--bg-1); color: var(--text); }
  .sidenav a.sidenav__item[aria-current="page"] { color: #fff; }
  .sidenav a.sidenav__item[aria-current="page"] svg { stroke: var(--accent); }
  .sidenav__post {
    margin: 14px 2px 8px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; border-radius: var(--radius);
    background: linear-gradient(145deg, var(--accent), var(--accent-2));
    color: #fff; font-weight: 700; font-size: 14.5px;
  }
  .sidenav__foot { margin-top: auto; padding: 14px 12px 4px; font-size: 11px; color: var(--text-3); line-height: 1.8; }
  .sidenav__foot a { display: inline-block; margin-right: 10px; }
  .sidenav__foot a:hover { color: var(--text-2); }

  /* 中央フィード：幅 420〜520px */
  .feed {
    width: 100%;
    max-width: var(--feed-w);
    margin-inline: auto;
    padding-block: 16px;
    scroll-padding-top: 16px;
  }
  .video-slide, .slide {
    height: calc(100svh - 32px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 16px;
    background: #050505;
  }
  .slide__media { padding: 16px 0; }
  .slide__meta { padding-bottom: 16px; }
  .rail { bottom: 16px; }
  .feed__empty { height: calc(100svh - 32px); }

  /* 上部オーバーレイはフィード幅に合わせる */
  .feed-top {
    left: var(--side-w); right: 0;
    padding-top: 14px;
    background: linear-gradient(180deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,0) 100%);
  }
  .feed-top .brand { display: none; }
  /* .feed-top 自体が左サイドナビ分を除いた領域なので 50% でそのまま中央になる */
  .feedtabs { left: 50%; }

  /* 右カラム（表示は 1280px 以上。ここでは配置のみ定義） */
  .rightrail {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
    width: 300px; padding: 22px 18px;
    overflow-y: auto;
    border-left: 1px solid var(--line-soft);
    background: var(--bg);
  }
  .rightrail__title { font-size: 12px; color: var(--text-3); font-weight: 700; letter-spacing: .06em; margin-bottom: 12px; }
  .rightrail__item {
    display: grid; grid-template-columns: 22px 44px 1fr; gap: 9px; align-items: center;
    padding: 7px 0;
  }
  .rightrail__item .thumb { aspect-ratio: 9 / 13; border-radius: 7px; }
  .rightrail__no { font-size: 13px; font-weight: 800; color: var(--text-3); text-align: center; }
  .rightrail__item:nth-child(-n+4) .rightrail__no { color: var(--accent); }
  .rightrail__name { font-size: 12.5px; font-weight: 600; line-height: 1.4;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .rightrail__stat { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
  .rightrail__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

  /* 通常ページも中央寄せ */
  .page { padding-bottom: 40px; }
  .container { max-width: 760px; }
  .footer { padding-bottom: 40px; }
  .submit-bar { bottom: 0; }
  .toast { bottom: 26px; }

  /* PC では統計はホバー時に表示（スマホでは常時表示のまま） */
  .grid-3 .gcell__stats { opacity: 0; }
  .grid-3 .gcell:hover .gcell__stats,
  .grid-3 .gcell:focus-visible .gcell__stats { opacity: 1; }
}

/* 右カラムは十分に広いときだけ表示する */
@media (min-width: 1280px) {
  .rightrail { display: block; }
  body:not(.is-bare) { padding-right: 300px; }
  .feed-top { right: 300px; }
  .feedtabs { left: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .feed { scroll-behavior: auto; }
}
