/* obsidianui.dev の実測値をもとにしたトークン（自前実装用） */
:root {
  --bg: #000; --chrome: #0f0f0f; --surface: #171717; --surface-2: #222; --surface-hover: #2a2a2a;
  --border: #1a1a1a; --border-card: #2e2e2e; --edge: color-mix(in srgb, #fafafa 9%, transparent);
  --fg: #fafafa; --heading: #ebebeb; --copy: #adaaa5; --muted: #a1a1a1; --badge-bg: #373737;
  --primary: #fafafa; --primary-fg: #171717; --ring: #a1a1a1; --danger: #fb2c36;
  --font-display: "Inter", system-ui, sans-serif; --font-body: "Geist", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --fs-hero: clamp(3rem, 5.5vw, 5.5rem); --fs-h2: clamp(2.25rem, 4vw, 3.75rem);
  --track-hero: -0.05em; --track-h2: -0.025em; --track-logo: -0.055em;
  --r-sm: 7px; --r: 10px; --r-md: 16px; --r-lg: 24px; --r-card: 22px; --r-full: 999px;
  --container: 80rem; --header-h: 56px; --grid-gap: 0.75rem;
  --shadow-hero: 0 8px 30px rgb(0 0 0 / .3); --shadow-btn: 0 4px 5px rgb(0 0 0 / .2);
  --hero-bg: radial-gradient(600px, rgb(255 255 255 / .03), transparent 40%), linear-gradient(#000, #0d0d0d 50%, #111);
  --title-grad: linear-gradient(#fff, #e4e4e7 50%, #9f9fa9);
  --raised: linear-gradient(#2c2c2e, #18181a);
  --ease: cubic-bezier(.4, 0, .2, 1); --ease-out-expo: cubic-bezier(.22, 1, .36, 1);
  --dur-fast: .15s; --dur: .2s; --dur-slow: .3s;
}
/* 出現: opacity 0 + blur(3px) + translateY(12px) → 0。押下 scale(.96)。prefers-reduced-motion で無効化 */

/* app.css — design-tokens.css（docs/）の後ろに連結して配信される。自前実装。 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 15px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--ring); outline-offset: 2px;
}
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; }
.skip:focus { left: 8px; background: var(--primary); color: var(--primary-fg); padding: 6px 12px; border-radius: var(--r-full); }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--chrome) 80%, transparent);
  backdrop-filter: saturate(140%) blur(12px); -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 16px; }
.logo {
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: var(--track-logo);
}
.logo-mark {
  width: 22px; height: 22px; border-radius: 7px; background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-btn);
}
.search { margin-left: auto; flex: 0 1 320px; }
.search input {
  width: 100%; height: 36px; padding: 0 16px; border-radius: var(--r-full);
  background: var(--surface); color: var(--fg); border: 1px solid var(--border-card);
  font: inherit; font-size: 14px; transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.search input::placeholder { color: var(--muted); }
.search input:hover { background: var(--surface-2); }
.pr-badge {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; color: var(--muted);
  padding: 2px 8px; border-radius: var(--r-full); background: var(--badge-bg);
}
.pr-bar { background: var(--chrome); border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; padding: 6px 0; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border-radius: var(--r-full); border: 0; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--primary); color: var(--primary-fg); box-shadow: var(--shadow-btn); }
.btn-primary:hover { opacity: .9; }
.btn-ghost { background: var(--raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-btn); }
.btn-ghost:hover { background: var(--surface-hover); }
.btn-cta { height: 48px; padding: 0 28px; font-size: 15px; width: 100%; max-width: 360px; }

/* ---- hero ---- */
.hero { background: var(--hero-bg); border-bottom: 1px solid var(--border); padding: 96px 0 80px; text-align: center; }
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 0 16px; }
.hero-title, .section-title, .page-title, .item-title, .gate-title {
  font-family: var(--font-display); color: var(--heading);
  background: var(--title-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-title { font-size: var(--fs-hero); letter-spacing: var(--track-hero); line-height: 1.02; margin: 0; font-weight: 700; }
.hero-copy { color: var(--copy); max-width: 36rem; margin: 20px auto 0; font-size: 16px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }

/* ---- sections ---- */
.section { padding: 56px 0 8px; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.25rem); letter-spacing: var(--track-h2); line-height: 1.15; margin: 0 0 24px; font-weight: 700; }
.page-title { font-size: var(--fs-h2); letter-spacing: var(--track-h2); line-height: 1.1; margin: 0 0 32px; font-weight: 700; word-break: break-word; }
.center { text-align: center; }
.empty { color: var(--muted); }

/* ---- cards ---- */
.grid { display: grid; gap: var(--grid-gap); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card {
  position: relative; border-radius: var(--r-card); background: var(--surface); overflow: hidden;
  border: 1px solid var(--border-card); box-shadow: inset 0 0 0 1px var(--edge);
  transition: background var(--dur) var(--ease), transform var(--dur-slow) var(--ease-out-expo);
}
.card:hover { background: var(--surface-hover); transform: translateY(-2px); }
.card-link { display: flex; flex-direction: column; height: 100%; }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-placeholder {
  width: 100%; height: 100%; min-height: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center;
  background: var(--raised); color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
}
.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
/* FC2 の作品名は 60〜100 文字あるので 3 行で省略する（全文は作品ページの h1） */
.card-title {
  margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; color: var(--heading); word-break: break-word;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.card-price { margin: 0; color: var(--copy); font-family: var(--font-mono); font-size: 13px; }
.badge {
  align-self: flex-start; font-size: 11px; color: var(--fg); background: var(--badge-bg);
  padding: 2px 10px; border-radius: var(--r-full);
}

/* ---- pills ---- */
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: var(--r-full);
  background: var(--raised); box-shadow: inset 0 0 0 1px var(--edge); font-size: 14px;
  transition: background var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.pill:hover { background: var(--surface-hover); }
.pill:active { transform: scale(.96); }
.pill-sm { height: 28px; padding: 0 12px; font-size: 12px; color: var(--copy); }
.pill-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* ---- item ---- */
.item { padding-top: 24px; }
.breadcrumb { display: flex; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.breadcrumb a:hover { color: var(--fg); }
.item-layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.item-media {
  border-radius: var(--r-card); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border-card); box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-hero);
}
.item-media img { width: 100%; height: auto; }
.item-info { display: flex; flex-direction: column; gap: 14px; }
.item-title { font-size: clamp(1.6rem, 3vw, 2.4rem); letter-spacing: var(--track-h2); line-height: 1.2; margin: 0; word-break: break-word; }
.item-price { margin: 0; font-family: var(--font-mono); font-size: 22px; color: var(--fg); }
.tax { font-family: var(--font-body); font-size: 12px; color: var(--muted); margin-left: 6px; }
.pr-inline { margin: 0; font-size: 12px; color: var(--muted); }
.cta-note { margin: 0; font-size: 12px; color: var(--muted); }
.item-code { display: block; font-family: var(--font-mono); font-size: 13px; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.item-seller { margin: 0; font-size: 13px; color: var(--copy); }
.item-seller a { text-decoration: underline; text-underline-offset: 3px; }
.item-seller a:hover { color: var(--fg); }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 32px; color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
/* FC2 公式の紹介用プレイヤー（16:9 レスポンシブ。frameborder の代わりに border: 0。#17） */
.item-player { margin-top: 32px; max-width: 960px; }
.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-card); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border-card); margin-bottom: 8px;
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.item-desc p { color: var(--copy); max-width: 44rem; white-space: pre-line; word-break: break-word; }
/* ランキング記録（#8） */
.stats-copy { color: var(--copy); max-width: 44rem; word-break: break-word; }
.stats-copy a, .stats-more a, .tag-top a { text-decoration: underline; text-underline-offset: 3px; }
.rank-table { border-collapse: collapse; font-family: var(--font-mono); font-size: 13px; margin: 8px 0 24px; min-width: 240px; }
.rank-table caption { text-align: left; color: var(--muted); font-family: var(--font-body); font-size: 12px; padding-bottom: 6px; }
.rank-table th, .rank-table td { border-bottom: 1px solid var(--border-card); padding: 6px 16px 6px 0; text-align: left; }
.rank-table th { color: var(--muted); font-weight: 500; }
.stats-subtitle { font-size: 16px; margin: 24px 0 8px; color: var(--heading); }
.tag-top { color: var(--copy); padding-left: 1.4em; margin: 0 0 8px; }
.tag-top li { margin: 4px 0; word-break: break-word; }
.tag-top-rank { color: var(--muted); font-family: var(--font-mono); font-size: 12px; margin-left: 8px; }
.stats-more { font-size: 13px; color: var(--muted); }
/* 週間・月間ランキング（#13） */
.rank-list { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-direction: column; gap: 12px; }
.rank-row { display: grid; grid-template-columns: 2.5rem 160px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border: 1px solid var(--border-card); border-radius: var(--r-card); background: var(--surface); }
.rank-pos { font-family: var(--font-mono); font-size: 20px; color: var(--fg); text-align: center; }
.rank-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: var(--surface-2); }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-title { color: var(--heading); font-weight: 600; line-height: 1.45; word-break: break-word; }
.rank-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.rank-meta a { text-decoration: underline; text-underline-offset: 3px; }
.period-list { color: var(--copy); padding-left: 1.2em; }
.period-list li { margin: 6px 0; }
.period-list a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) { .rank-row { grid-template-columns: 2rem 96px minmax(0, 1fr); gap: 10px; } }

/* ---- age gate ---- */
.gate { min-height: calc(100vh - var(--header-h) - 160px); display: grid; place-items: center; padding: 48px 20px; background: var(--hero-bg); }
.gate-card {
  width: 100%; max-width: 520px; text-align: center; padding: 40px 28px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border-card); box-shadow: inset 0 0 0 1px var(--edge), var(--shadow-hero);
}
.gate-title { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: var(--track-h2); margin: 0 0 12px; }
.gate-copy { color: var(--copy); margin: 0 0 28px; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.gate-note { color: var(--muted); font-size: 12px; margin: 20px 0 0; }

/* ---- footer ---- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); background: var(--chrome); padding: 32px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer p { margin: 0 0 8px; }
.footer-pr strong { color: var(--fg); font-weight: 600; }
.footer-copy { font-family: var(--font-mono); font-size: 12px; }

/* ---- motion: 出現（translateY 12px → 0）。opacity/blur は使わない:
   アニメーションが進まない環境（非表示タブ、クローラーのレンダラー等）でも本文とモーダルが見えるように ---- */
@keyframes reveal {
  from { transform: translateY(12px); }
  to { transform: none; }
}
.reveal { animation: reveal var(--dur-slow) var(--ease-out-expo) both; animation-duration: .6s; }
.hero .reveal:nth-child(2) { animation-delay: .06s; }
.hero .reveal:nth-child(3) { animation-delay: .12s; }
.hero .reveal:nth-child(4) { animation-delay: .18s; }
.grid .card:nth-child(2) { animation-delay: .04s; }
.grid .card:nth-child(3) { animation-delay: .08s; }
.grid .card:nth-child(4) { animation-delay: .12s; }
.grid .card:nth-child(n+5) { animation-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
}

/* ---- responsive ---- */
@media (max-width: 860px) {
  .item-layout { grid-template-columns: 1fr; }
  .btn-cta { max-width: none; }
}
@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .header-inner { gap: 10px; }
  .logo { font-size: 15px; }
  .pr-badge { display: none; }
  .hero { padding: 64px 0 56px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { border-radius: var(--r-md); }
  .card-body { padding: 10px 12px 14px; }
  .card-title { font-size: 13px; }
  .section { padding-top: 40px; }
}

/* ---- age modal（未同意時、本文の上に重ねる） ---- */
body.gated { overflow: hidden; height: 100vh; }
body.gated .page { filter: blur(14px); user-select: none; pointer-events: none; }
.age-modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: safe center; padding: 20px;
  background: rgb(0 0 0 / .72); overflow-y: auto; overscroll-behavior: contain;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.age-modal .gate-card { animation-duration: .4s; }
