
:root {
  --ink: #1c2230;
  --ink-soft: #4a5263;
  --muted: #6b7280;
  --paper: #fbfbfd;
  --panel: #ffffff;
  --line: #d9dde5;
  --sticker-yellow: #ffd84d;
  --sticker-red: #d7261e;
  --wait-blue: #2f6fde;
  --neutral: #8a93a3;
  --link: #1f56b8;
  --focus: #2f6fde;
  --chart-line: #1c2230;
  --chart-grid: #e6e9ef;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8ebf2;
    --ink-soft: #c2c8d4;
    --muted: #98a1b2;
    --paper: #12161f;
    --panel: #1a1f2b;
    --line: #2e3545;
    --wait-blue: #6b9cf0;
    --neutral: #7a8496;
    --link: #8fb4f5;
    --focus: #8fb4f5;
    --chart-line: #e8ebf2;
    --chart-grid: #262c3a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  font-feature-settings: "palt" 1;
}
a { color: var(--link); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
img { max-width: 100%; height: auto; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* 広告表記（全ページ） */
.ad-note {
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}

.site-header { padding-top: 20px; padding-bottom: 8px; }
.site-title {
  font-family: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1.2;
}
.site-title a { color: var(--ink); text-decoration: none; }
.site-lead { margin: 4px 0 0; color: var(--ink-soft); font-size: 14px; }

/* main には .wrap（padding: 0 16px）も付いているので、それより優先度の高い main.wrap で上下の余白を指定する */
/* ヘッダーの検索欄 */
.header-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.header-search input { flex: 1 1 220px; max-width: 360px; }
.header-search a { font-size: 13px; }

/* 検索ページ */
input[type="search"], select {
  font: inherit;
  font-size: 15px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  color: var(--ink);
}
button[type="submit"] {
  font: inherit;
  font-weight: 700;
  padding: 6px 16px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
.search-form { border: 1px solid var(--line); background: var(--panel); padding: 16px; margin-top: 8px; }
.search-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.search-row + .search-row, .search-row + .tags-field { margin-top: 12px; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.field--wide { flex: 1 1 260px; }
.field--wide input { width: 100%; }
.search-row--checks .check { font-size: 15px; display: flex; gap: 6px; align-items: center; }
.tags-field { border: 0; padding: 0; margin: 12px 0 0; }
.tags-field legend { font-size: 13px; color: var(--muted); padding: 0; margin-bottom: 6px; }
.tag-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-check {
  display: inline-flex; gap: 4px; align-items: center;
  font-size: 13px; padding: 2px 10px 2px 6px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.tag-check:has(input:checked) { border-color: var(--ink); background: var(--paper); font-weight: 700; }
.tags-field details { margin-top: 8px; }
.tags-field summary { font-size: 13px; cursor: pointer; color: var(--link); margin-bottom: 6px; }
.search-actions { display: flex; gap: 16px; align-items: center; margin-top: 16px; }
.pager { display: flex; gap: 24px; margin-top: 28px; }

main.wrap { padding-top: 16px; padding-bottom: 64px; }
.page-title { font-size: 20px; margin: 24px 0 4px; line-height: 1.4; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
h2 { font-size: 20px; margin: 40px 0 4px; line-height: 1.4; }
.section-lead { margin: 0 0 12px; color: var(--muted); font-size: 14px; }

/* 判定のシール */
.sticker {
  display: inline-grid;
  place-items: center;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  font-family: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif;
  font-size: 15px;
  line-height: 1;
  flex: none;
  transform: rotate(-8deg);
}
.sticker--buy {
  background: var(--sticker-yellow);
  color: var(--sticker-red);
  box-shadow: inset 0 0 0 3px var(--sticker-red), inset 0 0 0 5px var(--sticker-yellow), inset 0 0 0 6px var(--sticker-red);
}
.sticker--wait { background: var(--wait-blue); color: #fff; }
.sticker--neutral { background: transparent; color: var(--neutral); box-shadow: inset 0 0 0 2px var(--neutral); transform: none; }
.sticker--large { font-size: 26px; }

/* 一覧: 表紙が主役のタイル。シールは表紙の右上に重ねて貼る */
.work-grid {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 28px 18px;
}
.tile a { display: block; color: inherit; text-decoration: none; }
.tile-cover { position: relative; margin-bottom: 8px; }
.tile-cover img, .tile-noimg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--line);
  border-radius: 2px;
}
.tile-noimg { display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.tile-cover .sticker { position: absolute; top: -10px; right: -8px; font-size: 14px; }
.tile-cover .sticker--neutral { background: var(--panel); }
.tile-left {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border-radius: 2px;
}
.tile a:hover .tile-title { text-decoration: underline; }
.tile-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  /* 1行のタイトルでも2行分の高さを取り、価格の位置を揃える */
  min-height: 3em;
}
.tile-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .price { text-align: left; margin-top: 2px; }
.price { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price-now { font-family: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif; font-size: 18px; }
.price-list { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.price-off { font-size: 12px; color: var(--sticker-red); font-weight: 700; }
@media (prefers-color-scheme: dark) { .price-off { color: #ff7a72; } }
.empty { color: var(--muted); padding: 16px 0; }

@media (max-width: 560px) {
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .tile-cover .sticker { font-size: 11px; top: -8px; right: -4px; }
  .tile-title { font-size: 14px; }
  .price-now { font-size: 16px; }
}

/* 作品ページ */
.work-head { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 24px; align-items: start; }
.work-head img { width: 100%; border-radius: 2px; background: var(--line); }
.work-head h1 { font-size: 22px; line-height: 1.5; margin: 0 0 4px; overflow-wrap: anywhere; }
.work-facts { margin: 0; font-size: 14px; color: var(--ink-soft); }
.work-facts div { display: flex; gap: 8px; }
.work-facts dt { color: var(--muted); min-width: 4.5em; }
.work-facts dd { margin: 0; }
.cover-link { display: block; color: var(--link); text-decoration: none; }
.cover-caption { display: block; margin-top: 6px; font-size: 13px; text-align: right; }
.cover-caption::after { content: " ↗"; }
.cover-link:hover .cover-caption { text-decoration: underline; }
.cover-link:hover img { opacity: 0.92; }
.work-head--noimg { grid-template-columns: 1fr; max-width: 640px; }
@media (max-width: 640px) { .work-head { grid-template-columns: 1fr; } }

.verdict {
  margin: 24px 0 0;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 20px;
  align-items: center;
}
.verdict-price { font-family: "Dela Gothic One", "Zen Kaku Gothic New", sans-serif; font-size: 34px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.verdict-store { font-size: 14px; color: var(--muted); }
.verdict-reason { grid-column: 1 / -1; margin: 12px 0 0; }
.verdict-note { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); }

.memo p { max-width: 40em; margin: 0; }
.stores { width: 100%; border-collapse: collapse; font-size: 15px; }
.stores th, .stores td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.stores th { font-size: 13px; color: var(--muted); font-weight: 400; }
.stores .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.buy-button {
  display: inline-block;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  border-radius: 2px;
  white-space: nowrap;
}
.buy-button:hover { opacity: 0.85; }
@media (max-width: 560px) {
  .stores thead { display: none; }
  .stores tr { display: grid; grid-template-columns: 1fr auto; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .stores td { border: 0; padding: 2px 0; }
  .stores td:last-child { grid-column: 1 / -1; padding-top: 8px; }
}

.chart { width: 100%; max-width: 720px; height: auto; display: block; }
.chart--narrow { display: none; }
@media (max-width: 560px) {
  .chart--wide { display: none; }
  .chart--narrow { display: block; }
}
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--chart-line); stroke-width: 2; }
.chart .dot { fill: var(--chart-line); }
.chart text { fill: var(--muted); font-size: 12px; font-family: inherit; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: 13px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); }

.prose { max-width: 40em; }
.prose h1 { font-size: 24px; }

.site-footer { border-top: 1px solid var(--line); padding: 20px 0 40px; font-size: 13px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }

/* 年齢確認 */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.age-gate-box {
  max-width: 420px;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 28px 24px;
  text-align: center;
}
.age-gate-box h2 { margin: 0 0 8px; }
.age-gate-box p { margin: 0 0 20px; font-size: 14px; color: var(--ink-soft); }
.age-gate-actions { display: grid; gap: 10px; }
.age-gate button {
  font: inherit;
  font-weight: 700;
  padding: 12px;
  border: 0;
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
}
body.gated { overflow: hidden; }
