/* ============================================================
   Fans-Fan — Instagram風・白基調のスタイルシート
   generate.ts が site/public/assets/style.css へコピーする元ファイル。
   外部リソース（CDN・Webフォント・画像）は一切使用しない。
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --fg: #262626;
  --fg-muted: #8e8e8e;
  --fg-soft: #6b6b6b;
  --border: #dbdbdb;
  --border-soft: #efefef;
  --brand: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 14px rgba(0, 0, 0, .05);
  --shadow-hi: 0 2px 6px rgba(0, 0, 0, .07), 0 12px 28px rgba(0, 0, 0, .1);
  --header-h: 104px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
          "Noto Sans JP", "Yu Gothic Medium", Meiryo, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg);
  background: var(--bg-soft);
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; }

/* --- グラデーション文字（ブランド専用） --- */
.grad-text {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   ヘッダー
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 16px 0;
  text-align: center;
}

.brand {
  display: inline-block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.brand:hover { text-decoration: none; opacity: .85; }

.brand-sub {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--fg-muted);
  letter-spacing: .04em;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
}

.tab {
  position: relative;
  display: block;
  padding: 10px 16px 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  letter-spacing: .02em;
}

.tab:hover { text-decoration: none; color: var(--fg); }

.tab.is-active {
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.tab.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

/* ============================================================
   レイアウト
   ============================================================ */

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 16px 56px;
}

.page-head { margin: 4px 0 14px; }

.page-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .01em;
}

.page-lead {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--fg-muted);
}

.r18-chip {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: var(--fg-muted);
  vertical-align: 2px;
}

/* ============================================================
   クリエイター横スクロール（ストーリーズ風）
   ============================================================ */

.stories-wrap {
  margin: 0 -16px 18px;
  padding: 12px 0 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
}

.stories {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px 8px;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.stories::-webkit-scrollbar { display: none; }

.story { flex: 0 0 auto; width: 68px; }

.story-link { display: block; text-align: center; }

.story-link:hover { text-decoration: none; }

.story-ring {
  display: block;
  width: 64px;
  height: 64px;
  padding: 2px;
  border-radius: 50%;
  background: var(--brand);
}

.story-ring > * {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
}

.story-ring > img {
  background: var(--bg-soft);
  object-fit: cover;
}

.story-name {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  line-height: 1.3;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-link:hover .story-name { color: var(--fg-soft); }

/* アバター未取得時のプレースホルダ */
.avatar-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  text-transform: uppercase;
}

/* ============================================================
   サムネグリッド
   ============================================================ */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}

@media (min-width: 960px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
}

.card-item { min-width: 0; }

.card {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hi);
}

.card:focus-visible { outline: 2px solid #cc2366; outline-offset: 2px; }

/* 動画URLを持たないカード（サンプル表示など）はクリック不可 */
.card-static { cursor: default; }

.card-static:hover { transform: none; box-shadow: var(--shadow); }

.card-thumb {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  background: var(--bg-soft);
  overflow: hidden;
}

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

/* サムネがない場合のプレースホルダ（画像ファイルは使わない） */
.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(135deg, #f4f4f4 0 12px, #ededed 12px 24px);
}

.thumb-ph-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  color: #b9b9b9;
}

.rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  color: var(--fg);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}

.rank-badge.is-top {
  color: #fff;
  background: var(--brand);
}

.card-play {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
}

.card-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-42%, -50%);
  border-style: solid;
  border-width: 5px 0 5px 8px;
  border-color: transparent transparent transparent #fff;
}

.card-meta {
  display: block;
  padding: 8px 10px 10px;
}

.card-user {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-handle {
  display: block;
  font-size: 11px;
  color: var(--fg-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-stats {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--fg-soft);
}

.stat::before {
  margin-right: 3px;
  color: var(--fg-muted);
}

.stat-like::before { content: "\2665"; }

.stat-rp::before { content: "\21BB"; }

.stat-bm::before { content: "\1F516"; }

/* ============================================================
   クリエイターページ ヒーロー
   ============================================================ */

.creator-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 18px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.creator-ring {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 3px;
  border-radius: 50%;
  background: var(--brand);
}

.creator-ring > * {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--bg);
  font-size: 28px;
}

.creator-ring > img {
  background: var(--bg-soft);
  object-fit: cover;
}

.creator-info { min-width: 0; }

.creator-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}

.creator-handle {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
}

.creator-handle a:hover { color: var(--fg); }

.creator-stats {
  display: flex;
  gap: 20px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.creator-stat { font-size: 12px; color: var(--fg-muted); }

.creator-stat b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1.3;
}

/* ============================================================
   空状態
   ============================================================ */

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--fg-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.empty-text { margin: 0; font-size: 13px; }

/* ============================================================
   本文ページ（利用規約など）
   ============================================================ */

.prose {
  max-width: 760px;
  padding-top: 26px;
  background: transparent;
}

.prose h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.prose h2 {
  margin: 30px 0 8px;
  padding-left: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  border-left: 3px solid #dc2743;
}

.prose p { margin: 0 0 12px; }

.prose ul,
.prose ol { margin: 0 0 14px; padding-left: 1.3em; }

.prose li { margin-bottom: 6px; }

.prose a { color: #cc2366; text-decoration: underline; }

.prose .updated {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ============================================================
   ジャンル
   ============================================================ */

/* 人気ジャンルの横スクロールチップ（ランキング/ジャンル各ページ上部） */
.genre-chips-wrap {
  margin: 0 -16px 18px;
  padding: 10px 0 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 0;
  border-right: 0;
}

.genre-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 16px 4px;
  margin: 0;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}

.genre-chips::-webkit-scrollbar { display: none; }

.genre-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 7px 13px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.genre-chip:hover {
  text-decoration: none;
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.genre-chip .genre-count { font-size: 11px; font-weight: 700; color: var(--fg-muted); }

.genre-chip:hover .genre-count { color: rgba(255, 255, 255, .85); }

/* 選択中ジャンル／「すべて」チップのハイライト */
.genre-chip.is-active {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
}

.genre-chip.is-active .genre-count { color: rgba(255, 255, 255, .85); }

/* ジャンル一覧グリッド */
.genre-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}

@media (min-width: 960px) {
  .genre-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.genre-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease;
}

.genre-card:hover {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: var(--shadow-hi);
}

.genre-card-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  color: var(--fg);
}

.genre-card-count { flex: none; font-size: 12px; font-weight: 700; color: var(--fg-muted); }

.genre-card-count b {
  margin-right: 2px;
  background: var(--brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   フッター
   ============================================================ */

.site-footer {
  padding: 26px 16px 40px;
  background: var(--bg);
  border-top: 1px solid var(--border);
  text-align: center;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 18px;
  margin-bottom: 10px;
}

.site-footer nav a { font-size: 12px; color: var(--fg-soft); }

.notice18,
.copyright {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--fg-muted);
}

/* ============================================================
   動画モーダル
   ============================================================ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .72);
  animation: ff-fade .16s ease;
}

@keyframes ff-fade { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 46px 12px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-ring {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 2px;
  border-radius: 50%;
  background: var(--brand);
}

.modal-ring > * {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--bg);
  font-size: 14px;
}

.modal-ring > img {
  background: var(--bg-soft);
  object-fit: cover;
}

.modal-who { min-width: 0; }

.modal-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-handle {
  display: block;
  font-size: 12px;
  color: var(--fg-muted);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--fg-soft);
  font-size: 17px;
  line-height: 30px;
  cursor: pointer;
}

.modal-close:hover { background: var(--border-soft); color: var(--fg); }

.modal-video {
  display: block;
  width: 100%;
  max-height: 62vh;
  background: #000;
}

.modal-text {
  margin: 0;
  padding: 10px 14px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--fg-soft);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px 14px;
}

.btn {
  display: block;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
}

.btn:hover { text-decoration: none; background: var(--bg-soft); }

.btn-cta {
  border: 0;
  color: #fff;
  background: var(--brand);
}

.btn-cta:hover { background: var(--brand); opacity: .92; }

/* ============================================================
   年齢確認モーダル
   ============================================================ */

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(6px);
}

.age-gate-card {
  width: 100%;
  max-width: 380px;
  padding: 26px 22px 22px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .16);
}

.age-gate-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #fff;
  background: var(--brand);
}

.age-gate-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
}

.age-gate-text {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--fg-soft);
  text-align: left;
}

.age-gate-actions { display: flex; flex-direction: column; gap: 8px; }

.age-gate-btn {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  background: var(--bg);
  cursor: pointer;
}

.age-gate-btn.is-yes {
  border: 0;
  color: #fff;
  background: var(--brand);
}

.age-gate-btn.is-yes:hover { opacity: .92; }

.age-gate-btn.is-no { color: var(--fg-soft); }

.age-gate-btn.is-no:hover { background: var(--bg-soft); }

body.age-gate-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.modal-fallback {
  margin: 12px 16px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2, #f2f2f5);
  color: var(--fg-soft);
  font-size: 13px;
  text-align: center;
}
