/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== Design Tokens ===== */
:root {
  --bg:        #0d0b09;
  --surface-1: #161310;
  --surface-2: #1e1a16;
  --surface-3: #26211c;

  --border:       rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);

  --text-primary:   #ede8e2;
  --text-secondary: #9a9088;
  --text-muted:     #5c544c;

  --gold:        #c9a96e;
  --gold-dark:   #a07840;
  --gold-dim:    rgba(201,169,110,0.08);
  --gold-border: rgba(201,169,110,0.35);
  --gold-bar:    linear-gradient(90deg, #a07840, #c9a96e);

  --rank-1: #d4af6a;
  --rank-2: #a8a8a8;
  --rank-3: #a07040;

  --up:   #4a8f5a;
  --down: #8f4a4a;
  --red:  #b03030;

  --font: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;
}

/* ===== Base ===== */
html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text-secondary); text-decoration: none; }
a:hover { color: var(--text-primary); }

/* ===== Layout ===== */
.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.2rem;
}

/* ===== Age Gate ===== */
.age-gate-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.age-gate {
  max-width: 440px;
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  text-align: center;
}

.age-gate__title {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.age-gate__subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.age-gate__warning {
  background: rgba(176,48,48,0.08);
  border: 1px solid rgba(176,48,48,0.25);
  border-radius: 6px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.age-gate__question {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
}

.age-gate__buttons {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.age-gate__note {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  letter-spacing: 0.02em;
  transition: all 0.15s ease;
  text-align: center;
  width: 100%;
}

.btn--age-yes {
  background: var(--red);
  color: #fff;
}
.btn--age-yes:hover { background: #923030; }

.btn--age-no {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn--age-no:hover { border-color: var(--border-hover); color: var(--text-secondary); }

.btn--fanza {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--text-primary);
  width: auto;
  font-size: 0.78rem;
  padding: 0.45rem 0.9rem;
  white-space: nowrap;
}
.btn--fanza:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }

/* ===== Site Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,11,9,0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
}
.site-logo:hover { color: var(--text-primary); }

.site-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Hero ===== */
.hero {
  padding: 2rem 0 1.2rem;
}

.hero__eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.6rem;
}

.hero__title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  color: var(--text-primary);
}

/* ===== Score Detail ===== */
.score-detail {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 1rem;
  margin-bottom: 1.2rem;
  font-size: 0.82rem;
}

.score-detail summary {
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 500;
  list-style: none;
  font-size: 0.8rem;
}
.score-detail summary::-webkit-details-marker { display: none; }
.score-detail summary::before { content: '▶ '; font-size: 0.65em; color: var(--text-muted); }
details[open] .score-detail summary::before { content: '▼ '; }

.score-detail__body {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.score-detail__body code {
  background: var(--surface-3);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.82em;
  color: var(--text-primary);
  display: block;
}

/* ===== Sort Bar ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.sort-bar__label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-bar__wrap {
  position: relative;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23888'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.82rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.sort-select:focus {
  outline: none;
  border-color: var(--gold);
}

/* ===== Ranking List ===== */
.ranking-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 4rem;
}

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

/* ===== Card ===== */
.card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  opacity: 0;
  animation: fadeInUp 0.35s ease forwards;
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--border-hover); }

.card--hero {
  background: linear-gradient(135deg, rgba(201,169,110,0.06) 0%, var(--surface-1) 55%);
  border-color: var(--gold-border);
  padding: 16px 18px;
  flex-wrap: wrap;
}
.card--hero:hover { border-color: rgba(201,169,110,0.55); }

.card__hero-label {
  width: 100%;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 6px;
  opacity: 0.85;
}

.card--clickable { cursor: pointer; }

/* rank number */
.card__rank {
  font-size: 1.3rem;
  font-weight: 600;
  min-width: 2rem;
  text-align: center;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text-muted);
}
.card__rank--1 { color: var(--rank-1); }
.card__rank--2 { color: var(--rank-2); font-size: 1.2rem; }
.card__rank--3 { color: var(--rank-3); font-size: 1.2rem; }

/* thumbnail */
.card__thumb {
  position: relative;
  width: 56px;
  height: 80px;
  background: var(--surface-3);
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 3px;
  line-height: 1.4;
}
.badge--new  { background: var(--red); color: #fff; position: absolute; top: 3px; left: 3px; }
.badge--up   { color: var(--up);   border: 1px solid var(--up);   background: rgba(74,143,90,0.1); }
.badge--down { color: var(--down); border: 1px solid var(--down); background: rgba(143,74,74,0.1); }
.badge--same { color: var(--text-muted); border: 1px solid var(--border); }
.badge--new-entry { color: var(--gold); border: 1px solid var(--gold-border); background: var(--gold-dim); }

/* card body */
.card__body { flex: 1; min-width: 0; }

.card__maker {
  font-size: 0.62rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__title {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
  margin-bottom: 2px;
}

.card__actress {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 5px;
}

.card__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 5px;
}

.genre-tag {
  font-size: 0.6rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1px 7px;
  font-weight: 400;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.genre-tag--more {
  color: var(--text-muted);
  border-color: transparent;
}

.card__meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

/* score */
.card__score {
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

.score__val {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score__label {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 3px 0 5px;
}

.bar-bg {
  height: 5px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--gold-bar);
  border-radius: 2px;
  transition: width 0.5s ease-out;
}

/* action */
.card__action {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.card__price {
  font-size: 0.68rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* スマホ: ボタン非表示・価格をメタ行へ */
.card__price--meta { display: none; }

/* ===== Article Page ===== */
.page-article {
  padding: 2.5rem 0 4rem;
}

.page-article__title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.page-article__updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}

.page-article h2 {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 2.2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.page-article h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.page-article p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 0.8rem;
}

.page-article ul, .page-article ol {
  padding-left: 1.4rem;
  margin-bottom: 0.8rem;
}

.page-article li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.85;
  margin-bottom: 0.3rem;
}

.page-article code {
  background: var(--surface-3);
  padding: 0.35rem 0.7rem;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--text-primary);
  display: block;
  margin: 0.8rem 0;
}

.page-article__example {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  margin: 1rem 0;
}

.page-article__example-title {
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 0.8rem;
}

.page-article__example table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.page-article__example th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  padding: 0.3rem 0.6rem 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
}

.page-article__example td {
  padding: 0.35rem 0.6rem 0.35rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}

.page-article__example tr:last-child td { border-bottom: none; }

.page-article__example .result-row td {
  color: var(--gold);
  font-weight: 700;
  border-top: 1px solid var(--border);
}

/* ===== List Status ===== */
.list-status {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 0;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 1rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin-bottom: 0.8rem;
}

.footer-nav a { font-size: 0.78rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--text-secondary); }

.footer-copy { font-size: 0.7rem; color: var(--text-muted); }

/* ===== Detail Back Link ===== */
.detail-back {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.detail-back:hover { color: var(--text-secondary); }

/* ===== Detail Layout ===== */
.detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  padding: 2rem 0 6rem;
  align-items: start;
}

.detail-sidebar__sticky {
  position: sticky;
  top: 4.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-package {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: block;
}

.detail-score-block { text-align: center; }

.detail-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.btn--fanza-main {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  justify-content: center;
}

/* ===== Detail Main ===== */
.detail-maker {
  font-size: 0.68rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
  margin-bottom: 0.4rem;
}

.detail-actress {
  font-size: 1rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 0.8rem;
}

.detail-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 0.8rem;
}

.detail-meta__sep { color: var(--border); }

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 1.5rem;
}

.detail-section { margin-bottom: 2rem; }

.detail-section__title {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.detail-section__title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.detail-description {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* ===== Sample Image Gallery ===== */
.detail-sample {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.detail-sample::-webkit-scrollbar { height: 3px; }
.detail-sample::-webkit-scrollbar-track { background: var(--surface-2); }
.detail-sample::-webkit-scrollbar-thumb { background: var(--gold-dark); border-radius: 2px; }

.detail-sample__img {
  height: 160px;
  width: auto;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  object-fit: cover;
}

/* ===== Detail mobile CTA (hidden on PC) ===== */
.detail-cta-mobile { display: none; }

/* ===== Sticky CTA (mobile only) ===== */
.detail-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(13,11,9,0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 0.8rem 0;
  z-index: 200;
}

.detail-sticky-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.detail-sticky-cta__price {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn--fanza-sticky {
  width: auto;
  padding: 0.65rem 1.5rem;
  font-size: 0.88rem;
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .card { gap: 9px; padding: 12px; }
  .card--hero { padding: 14px 12px; }
  .card__rank { min-width: 1.6rem; font-size: 1.1rem; }
  .card__thumb { width: 46px; height: 66px; }
  .card__title { font-size: 0.82rem; }
  .card__action { display: none; }
  .card__price--meta { display: inline; }
  .score__val { font-size: 1.1rem; }
  .hero__title { font-size: 1.25rem; }
  .sort-tab { padding: 0.5rem 0.7rem; font-size: 0.75rem; }

  /* Detail page mobile */
  .detail-layout {
    grid-template-columns: 1fr;
    padding: 1.2rem 0 5rem;
    gap: 1.2rem;
  }
  .detail-sidebar { display: none; }
  .detail-cta-mobile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
  }
  .detail-cta-mobile .detail-price { text-align: center; }
  .detail-cta-mobile .btn--fanza-main { width: 100%; }
  .detail-sticky-cta { display: block; }
  .detail-title { font-size: 1.15rem; }
  .detail-sample__img { height: 120px; }
}
