:root {
  --bg: #141217;
  --surface: #1f1c24;
  --border: #34303b;
  --text: #ece9f0;
  --muted: #9b95a5;
  --accent: #ff4f7b;
  --sale: #ffb020;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  line-height: 1.6;
}

a { color: inherit; }

/* 年齢確認前は本文を隠す */
.gate-pending body > :not(#age-gate) { display: none; }
html:not(.gate-pending) .age-gate { display: none; }

.age-gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  z-index: 100;
}
.age-gate-box {
  max-width: 420px;
  width: 100%;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.age-gate-box h2 { margin-top: 0; }
.age-gate-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.btn-yes, .btn-no {
  display: block;
  padding: 12px;
  border-radius: var(--radius);
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn-yes { border: 0; background: var(--accent); color: #fff; font-weight: bold; }
.btn-no { border: 1px solid var(--border); color: var(--muted); }
.noscript { color: var(--sale); }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.logo { font-weight: bold; font-size: 1.2rem; text-decoration: none; color: var(--accent); }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-header nav a {
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}
.site-header nav a[aria-current="page"] { background: var(--surface); color: var(--text); }

.pr-notice, .sample-notice {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--surface);
}
.sample-notice { color: var(--sale); }

main { max-width: 1200px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.4rem; line-height: 1.4; margin: 8px 0 16px; }
h2 { font-size: 1.15rem; margin: 32px 0 12px; padding-left: 10px; border-left: 4px solid var(--accent); }
.lead, .note { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); }

/* トップの案内 */
.hero { padding: 20px; margin-bottom: 8px; background: linear-gradient(135deg, #2a1d2b, #1c1a26); border: 1px solid var(--border); border-radius: var(--radius); }
.hero-lead { margin: 0 0 6px; font-size: 1.25rem; font-weight: bold; color: var(--accent); }
.hero p:last-child { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* パンくず・タブ・チップ */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: 0.8rem; color: var(--muted); }
.breadcrumbs li:not(:last-child)::after { content: "›"; margin-left: 4px; }
.breadcrumbs li[aria-current] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.breadcrumbs a { color: var(--muted); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 8px; }
.tabs a { flex: none; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 0.85rem; }
.tabs a:hover { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 3px 12px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; font-size: 0.8rem; color: var(--muted); }
.chip:hover { color: var(--text); border-color: var(--accent); }
.more { text-align: right; margin: 8px 0 0; }
.more a { color: var(--accent); text-decoration: none; font-size: 0.9rem; }

/* 作品カード（表紙は縦長。画像は縮小のみで切り抜かない） */
.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 160px), 1fr));
  gap: 14px 12px;
}
.card a { display: block; text-decoration: none; }
.card a:hover .title { color: var(--accent); }
.thumb { position: relative; aspect-ratio: 5 / 7; background: #0b0a0d; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rank, .badge { position: absolute; top: 6px; padding: 1px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.rank { left: 6px; background: #3b3743; color: #fff; }
.rank.top { background: var(--accent); }
.badge { right: 6px; background: var(--sale); color: #000; }
.title { margin: 6px 0 2px; font-size: 0.85rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stars { margin: 2px 0 0; font-size: 0.75rem; color: var(--sale); }

/* 作品ページ */
.work { display: grid; grid-template-columns: minmax(0, 320px) 1fr; gap: 20px; align-items: start; }
.work-cover { background: #0b0a0d; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.work-cover img { width: 100%; height: auto; display: block; }
.intro { margin-top: 0; }
.spec { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 12px 0; }
.spec th, .spec td { padding: 8px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.spec th { width: 6em; color: var(--muted); font-weight: normal; white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.btn { display: inline-block; padding: 12px 22px; border-radius: 999px; text-decoration: none; font-weight: bold; text-align: center; }
.btn.trial { background: var(--accent); color: #fff; }
.btn.buy { border: 1px solid var(--accent); color: var(--accent); }
.btn:hover { filter: brightness(1.15); }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; }
.samples img { width: 100%; height: auto; display: block; border-radius: 8px; background: #0b0a0d; }
@media (max-width: 640px) {
  .work { grid-template-columns: 1fr; }
  .work-cover { max-width: 260px; margin: 0 auto; }
  .actions .btn { flex: 1 1 100%; }
}

/* 読みもの・固定ページ */
.prose { max-width: 760px; }
.prose h2 { margin-top: 28px; }
.prose a { color: var(--accent); }
.guide-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.guide-list li { padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.guide-list a { font-weight: bold; text-decoration: none; }
.guide-list a:hover { color: var(--accent); }
.guide-list p { margin: 4px 0 0; color: var(--muted); font-size: 0.85rem; }

.about { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; }
.about dt { color: var(--muted); }
.about dd { margin: 0; }
@media (max-width: 560px) {
  .about { grid-template-columns: 1fr; }
  .about dd { margin-bottom: 8px; }
}

.site-footer { padding: 24px 16px; border-top: 1px solid var(--border); font-size: 0.8rem; color: var(--muted); text-align: center; }
.site-footer a { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 検索 */
.site-search { display: flex; flex: 1 1 260px; max-width: 420px; gap: 6px; order: 3; }
.site-search input, .search-form input[type="search"], .tag-box input, .search-form select {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit;
}
.site-search button { padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: bold; cursor: pointer; }
.site-header nav { order: 2; }
@media (max-width: 640px) { .site-search { max-width: none; flex-basis: 100%; } }
.search-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.search-form input[type="search"] { flex: 1 1 100%; font-size: 1rem; padding: 10px 14px; }
.search-form select { flex: 0 1 auto; }
.search-sale { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--muted); }
.tag-box { margin: 8px 0 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tag-box summary { cursor: pointer; font-size: 0.9rem; color: var(--muted); }
.tag-box input { display: block; width: 100%; margin: 10px 0; }
button.chip { background: none; cursor: pointer; font: inherit; font-size: 0.8rem; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips.selected { margin-bottom: 4px; }
.chip.clear { border-style: dashed; }
.more-btn { display: block; margin: 20px auto; padding: 10px 32px; border-radius: 999px; border: 1px solid var(--accent); background: none; color: var(--accent); font: inherit; cursor: pointer; }

/* 続きを読む */
.read-more { margin: 28px 0; padding: 20px; text-align: center; background: linear-gradient(135deg, #2a1d2b, #1c1a26); border: 1px solid var(--border); border-radius: var(--radius); }
.read-more p { margin: 0 0 12px; color: var(--muted); }
.btn.big { padding: 16px 48px; font-size: 1.1rem; }
@media (max-width: 640px) { .btn.big { display: block; } }

/* みんなの評価とコメント */
.rating-box { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.rating-summary { margin: 0; display: flex; align-items: baseline; gap: 8px; }
.rating-avg { font-size: 1.6rem; font-weight: bold; color: var(--sale); }
.rating-count { color: var(--muted); font-size: 0.85rem; }
.rate { display: flex; gap: 2px; }
.rate button { padding: 2px 4px; border: 0; background: none; font-size: 1.8rem; line-height: 1; color: #4a4553; cursor: pointer; }
.rate button.on, .rate:hover button { color: var(--sale); }
.rate button:hover ~ button { color: #4a4553; }
.rate-note { flex-basis: 100%; margin: 0; font-size: 0.8rem; color: var(--muted); }
.comment-form { display: grid; gap: 8px; margin: 14px 0; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.comment-actions .btn { border: 0; cursor: pointer; font: inherit; font-weight: bold; padding: 10px 26px; }
.comment-note { font-size: 0.75rem; color: var(--muted); }
.comment-note a { color: var(--muted); }
.comment-error { margin: 0; color: #ff8a8a; font-size: 0.85rem; }
.comments, .recent-comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comments li, .recent-comments li { padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.comment-head { margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 0.8rem; color: var(--muted); }
.comment-head strong { color: var(--text); }
.comment-body { margin: 0; white-space: pre-wrap; word-break: break-word; }
.report { margin-left: auto; padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: 0.75rem; cursor: pointer; text-decoration: underline; }
.recent-comments a { font-weight: bold; text-decoration: none; }
.recent-comments .comment-body { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.community-grid { list-style: none; }

/* メニュー：スマホでも1行で横にスクロールできるように */
.main-nav { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a { flex: none; }
.main-nav a[aria-current="page"] { background: var(--accent); color: #fff; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.period-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 4px 0 0; justify-content: flex-end; }
.period-links a { color: var(--accent); text-decoration: none; font-size: 0.85rem; }

/* 編集部 今日のイチオシ！ */
.picks { margin-bottom: 8px; }
.pick-hero { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 18px; padding: 16px; text-decoration: none; background: linear-gradient(135deg, #2a1d2b, #1c1a26); border: 1px solid var(--border); border-radius: var(--radius); }
.pick-hero:hover { border-color: var(--accent); }
.pick-cover { background: #0b0a0d; border-radius: 8px; overflow: hidden; }
.pick-cover img { width: 100%; height: auto; display: block; }
.pick-label { margin: 0; display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; font-weight: bold; }
.pick-title { margin: 8px 0 4px; font-size: 1.15rem; font-weight: bold; line-height: 1.4; }
.pick-meta { margin: 0 0 10px; color: var(--muted); font-size: 0.85rem; }
.pick-comment { margin: 0 0 14px; padding: 10px 12px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--sale); border-radius: 4px; }
.pick-sub { margin: 16px 0 8px; font-weight: bold; }
@media (max-width: 640px) {
  .pick-hero { grid-template-columns: 1fr; }
  .pick-cover { max-width: 220px; margin: 0 auto; }
}

/* フッターのサイトマップ */
.footer-map { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; max-width: 1100px; margin: 0 auto 20px; text-align: left; }
.footer-map ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-head { margin: 0 0 6px; font-weight: bold; color: var(--text); }
.footer-head a { color: var(--text); text-decoration: none; }
.footer-map a { text-decoration: none; }
.footer-map a:hover { color: var(--accent); }

/* 作品ページ：開いたらすぐ読める */
.reader-meta { margin: -8px 0 6px; color: var(--muted); font-size: 0.85rem; }
.reader { max-width: 760px; margin: 12px auto 0; display: grid; gap: 6px; }
.reader img { width: 100%; height: auto; display: block; background: #0b0a0d; border-radius: 4px; }
.trial-top { display: grid; grid-template-columns: minmax(0, 260px) 1fr; gap: 20px; align-items: center; padding: 16px; background: linear-gradient(135deg, #2a1d2b, #1c1a26); border: 1px solid var(--border); border-radius: var(--radius); }
.trial-cover { background: #0b0a0d; border-radius: 8px; overflow: hidden; }
.trial-cover img { width: 100%; height: auto; display: block; }
.trial-body { display: grid; gap: 10px; justify-items: start; }
.trial-body .note { margin: -4px 0 0; }
@media (max-width: 640px) {
  .trial-top { grid-template-columns: 1fr; }
  .trial-cover { max-width: 240px; margin: 0 auto; }
  .trial-body { justify-items: stretch; text-align: center; }
}
.badge.read { left: auto; right: 6px; top: auto; bottom: 6px; background: rgba(0, 0, 0, 0.75); color: #fff; font-weight: normal; }

/* ページ送り・表示件数 */
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; margin: 4px 0 10px; }
.range { margin: 0; color: var(--muted); font-size: 0.85rem; }
.per-page { margin: 0; display: flex; gap: 6px; align-items: center; font-size: 0.85rem; color: var(--muted); }
.per-page a, .per-page span { padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); }
.per-page [aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0 8px; }
.pager a, .pager span { min-width: 40px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; text-align: center; text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager [aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }
.pager .gap { border: 0; min-width: auto; padding: 8px 2px; color: var(--muted); }
.pager .prev, .pager .next { font-weight: bold; }

/* 本文へスキップ（キーボード操作のときだけ見える） */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 60; padding: 8px 14px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: bold; text-decoration: none; }
.skip-link:focus { top: 8px; }
main:focus { outline: none; }

/* 三本線メニュー */
.menu-btn { order: 4; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.menu-btn:hover { border-color: var(--accent); }
.menu-icon, .menu-icon::before, .menu-icon::after { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ""; position: absolute; left: 0; }
.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
@media (max-width: 640px) {
  .menu-btn { order: 1; margin-left: auto; }
  .menu-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-header nav.main-nav { flex-basis: 100%; }
}

.drawer { position: fixed; inset: 0 0 0 auto; width: min(360px, 88vw); max-width: none; height: 100%; max-height: none; margin: 0; padding: 0 16px 24px; border: 0; border-left: 1px solid var(--border); background: var(--bg); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
.drawer::backdrop { background: rgba(0, 0, 0, 0.6); }
.drawer[open] { animation: drawer-in 0.18s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
.menu-open, .menu-open body { overflow: hidden; }
.drawer-head { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.drawer-title { margin: 0; font-weight: bold; }
.drawer-close { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.drawer-main { display: grid; gap: 4px; margin: 12px 0; }
.drawer-main a { display: block; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.drawer-main a[aria-current="page"] { background: var(--accent); color: #fff; }
.drawer-map { display: grid; gap: 16px; }
.drawer-map .footer-head { margin: 8px 0 4px; font-weight: bold; color: var(--muted); font-size: 0.85rem; }
.drawer-map .footer-head a { color: var(--muted); }
.drawer-map ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 8px; }
.drawer-map li a { display: block; padding: 8px 4px; text-decoration: none; }
.drawer-map li a:hover, .drawer-main a:hover { color: var(--accent); }

/* ページ上部へ戻る */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; display: grid; place-items: center; gap: 2px; width: 52px; height: 52px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: rgba(31, 28, 36, 0.92); color: var(--text); font: inherit; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.to-top[hidden] { display: none; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }
.to-top-arrow { width: 10px; height: 10px; margin-top: 6px; border-top: 2px solid currentColor; border-left: 2px solid currentColor; transform: rotate(45deg); }
.to-top-label { font-size: 0.65rem; line-height: 1; margin-bottom: 4px; }
@media (prefers-reduced-motion: reduce) { .drawer[open] { animation: none; } }

/* 作品ページのシェア */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.share { margin: 24px 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.share h2 { margin: 0 0 10px; font-size: 1rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 88px; padding: 8px 16px; border: 1px solid transparent; border-radius: 999px; font: inherit; font-size: 0.9rem; font-weight: bold; text-decoration: none; color: #fff; cursor: pointer; }
.share-btn[hidden] { display: none; }
.share-btn.x { background: #000; border-color: #555; }
.share-btn.line { background: #06c755; }
.share-btn.bsky { background: #1185fe; }
.share-btn.hatena { background: #00a4de; }
.share-btn.copy, .share-btn.native { background: var(--bg); border-color: var(--border); color: var(--text); }
.share-btn:hover { filter: brightness(1.15); }
.share-status { min-height: 1.2em; margin: 8px 0 0; font-size: 0.85rem; color: var(--sale); }
@media (max-width: 640px) { .share-btn { flex: 1 1 calc(50% - 8px); } }

/* 2つ目の提携先の一覧（横長の画像なので枠も横長に。縮小のみで切り抜かない） */
.grid.wide .thumb { aspect-ratio: 4 / 3; }
.pr-label { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; font-size: 0.7rem; color: var(--muted); vertical-align: middle; }
.tabs.d-lists { margin-top: -4px; }
.tabs.d-lists a { font-size: 0.85rem; }
.card .meta .cat { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); font-size: 0.7rem; }
.d-top .chips { margin: 0 0 10px; }

/* お気に入り（ハート）・作者リンク・マイページ */
.card { position: relative; }
.card .meta a.author { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.card .meta a.author:hover { color: var(--accent); }
.fav-btn { position: absolute; top: 6px; right: 6px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; background: rgba(20, 18, 23, 0.75); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.fav-btn:hover { border-color: var(--accent); }
.fav-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.fav-btn.big { position: static; display: inline-flex; gap: 6px; width: auto; height: auto; min-height: 44px; padding: 8px 18px; border-radius: 999px; background: var(--surface); border-color: var(--border); font-size: 0.95rem; font-weight: bold; }
.fav-btn.big .fav-icon { font-size: 1.2rem; }
.fav-row { margin: 8px 0 12px; }
.card .meta .why { display: block; color: var(--sale); font-size: 0.75rem; }
.main-nav a[data-badge]:not([data-badge=""])::after { content: attr(data-badge); margin-left: 4px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.7rem; }
.mypage-tabs { display: flex; gap: 6px; margin: 12px 0 16px; }
.mypage-tabs [role="tab"] { min-height: 44px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.mypage-tabs [role="tab"][aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.mypage-tabs .count:not(:empty) { margin-left: 4px; font-size: 0.8rem; opacity: 0.85; }
.clear-btn { margin-top: 16px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: none; color: var(--muted); font: inherit; cursor: pointer; }
.for-you { margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 50; margin: 0; padding: 10px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 0.85rem; font-weight: bold; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); }
.toast[hidden] { display: none; }
.rank-jump { position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
.rank-block { scroll-margin-top: 60px; }
.rank-block h3 { margin: 12px 0 8px; font-size: 0.95rem; color: var(--muted); }
.genre-guide { margin-top: 24px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.genre-guide h2 { margin-top: 0; font-size: 1rem; }

/* セール（割引率のバッジ・終了日・作品ページの帯） */
.badge.sale { left: 6px; right: auto; top: auto; bottom: 6px; background: var(--sale); color: #1a1200; }
.sale-end { margin: 0; color: var(--sale); font-size: 0.75rem; font-weight: bold; }
.sale-line { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 176, 32, 0.15); color: var(--sale); font-size: 0.9rem; }
.sale-top h2 { color: var(--sale); }

/* セール待ち（ベル） */
.watch-btn { position: absolute; top: 48px; right: 6px; z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 50%; background: rgba(20, 18, 23, 0.75); font-size: 0.95rem; line-height: 1; cursor: pointer; filter: grayscale(1); opacity: 0.85; }
.watch-btn:hover { border-color: var(--sale); opacity: 1; }
.watch-btn[aria-pressed="true"] { filter: none; opacity: 1; border-color: var(--sale); background: rgba(255, 176, 32, 0.2); }
.watch-btn.big { position: static; display: inline-flex; gap: 6px; width: auto; height: auto; min-height: 44px; margin-left: 8px; padding: 8px 18px; border-radius: 999px; background: var(--surface); border-color: var(--border); color: var(--text); font: inherit; font-size: 0.95rem; font-weight: bold; }
.watch-bell { order: 4; position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; font-size: 1.1rem; }
.watch-bell[hidden] { display: none; }
.watch-bell.has-new { border-color: var(--sale); animation: bell-ring 1.2s ease-in-out 2; }
.watch-count:not(:empty) { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--sale); color: #1a1200; font-size: 0.7rem; font-weight: bold; line-height: 20px; text-align: center; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-12deg); } 40% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .watch-bell.has-new { animation: none; } }
@media (max-width: 640px) { .watch-bell { order: 1; margin-left: auto; } .menu-btn { margin-left: 0; } }

/* ===== Material Design 風の部品（アイコン・固定バー・下のメニュー）===== */
:root {
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px 1px rgba(0, 0, 0, 0.25);
  --elev-2: 0 2px 6px 2px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.4);
  --state-hover: rgba(255, 255, 255, 0.08);
  --bottom-nav-h: 64px;
}
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* 上の固定バー（ロゴ・お知らせ・マイページ・メニュー）。どのページでも常に見える */
.app-bar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 4px 8px 4px 16px; padding-top: max(4px, env(safe-area-inset-top)); background: var(--bg); box-shadow: var(--elev-1); }
.app-bar .logo { margin-right: auto; }
.app-actions { display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); text-decoration: none; cursor: pointer; }
.icon-btn:hover { background: var(--state-hover); }
.icon-btn[aria-current="page"] { color: var(--accent); }
.app-bar .menu-btn { order: 0; margin: 0; min-height: 0; border: 0; }
.site-header { border-bottom: 0; }

/* お知らせのベル：新しくセールになった作品があると数字と色で知らせる */
.watch-bell { order: 0; width: 48px; height: 48px; border: 0; background: none; font-size: inherit; }
.watch-bell.has-new { color: var(--sale); border: 0; }
.watch-count:not(:empty) { top: 4px; right: 4px; }
@media (max-width: 640px) { .watch-bell { margin-left: 0; } }

/* お気に入り（ハート）・セール待ち（ベル）のボタン：押すと塗りつぶし */
.fav-btn, .watch-btn { color: #fff; filter: none; opacity: 1; box-shadow: var(--elev-1); }
.fav-btn .icon, .watch-btn .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.fav-btn[aria-pressed="true"] { color: var(--accent); }
.fav-btn[aria-pressed="true"] .icon { fill: currentColor; }
.watch-btn[aria-pressed="true"] { color: var(--sale); }
.watch-btn[aria-pressed="true"] .icon { fill: currentColor; }
.fav-btn, .watch-btn { width: 40px; height: 40px; }
.watch-btn { top: 52px; }
.fav-btn.big, .watch-btn.big { box-shadow: none; }
.fav-btn.big .icon, .watch-btn.big .icon { width: 22px; height: 22px; }
.fav-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fav-row .watch-btn.big, .fav-row .sale-line { margin-left: 0; }

/* マイページ：カードの下の「外す」「解除」 */
.remove-btn { display: block; width: 100%; min-height: 40px; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 0.8rem; cursor: pointer; }
.remove-btn:hover { border-color: var(--accent); color: var(--text); background: var(--state-hover); }

/* ドロワーの閉じる・ページ上部へ */
.drawer-close { display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: none; color: var(--text); }
.drawer-close:hover { background: var(--state-hover); }
.to-top { width: 56px; height: 56px; border: 0; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--elev-2); }
.to-top:hover { color: var(--accent); }

/* スマホの画面下のメニュー（トップ・ランキング・セール・検索・マイページ）。常に表示 */
.bottom-nav { display: none; }
@media (max-width: 767px) {
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.4); }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 0.7rem; }
  .bottom-nav .bn-icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; transition: background 0.15s; }
  .bottom-nav a[aria-current="page"] { color: var(--text); font-weight: bold; }
  .bottom-nav a[aria-current="page"] .bn-icon { background: rgba(255, 79, 123, 0.25); color: var(--accent); }
  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px)); }
  .to-top { bottom: calc(var(--bottom-nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(var(--bottom-nav-h) + 84px + env(safe-area-inset-bottom, 0px)); }
  /* 下のメニューと同じ入口は、上の横スクロールメニューでは種類だけにして縦の場所を節約 */
  .app-bar .icon-btn[href="/mypage/"] { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bottom-nav .bn-icon { transition: none; } }

/* 上のバーのベル：数字の入れ物が場所を取ってアイコンがずれないよう、常に重ねて置く */
.watch-bell .watch-count { position: absolute; top: 6px; right: 6px; }
.watch-bell .watch-count:empty { display: none; }

/* マイページのタブ（Material のタブ：アイコン＋短い文字、選んでいるタブに下線。スクロールしても上に残る） */
.mypage-tabs { position: sticky; top: 56px; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 8px -16px 16px; padding: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.mypage-tabs [role="tab"] { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 4px; border: 0; border-radius: 0; background: none; color: var(--muted); font: inherit; font-size: 0.75rem; cursor: pointer; }
.mypage-tabs [role="tab"]:hover { background: var(--state-hover); }
.mypage-tabs [role="tab"][aria-selected="true"] { background: none; color: var(--text); font-weight: bold; }
.mypage-tabs [role="tab"][aria-selected="true"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.mypage-tabs [role="tab"][aria-selected="true"] .icon { color: var(--accent); }
.mypage-tabs .mt-icon { position: relative; display: grid; place-items: center; }
.mypage-tabs .count { position: absolute; top: -6px; left: 14px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.65rem; font-weight: bold; line-height: 18px; text-align: center; opacity: 1; margin: 0; }
.mypage-tabs .count:empty { display: none; }
.mypage-tabs [aria-controls="panel-watch"] .count { background: var(--sale); color: #1a1200; }
.mypage-panel > h2 { font-size: 1rem; margin: 8px 0 12px; }
@media (min-width: 768px) { .mypage-tabs { margin-left: 0; margin-right: 0; } .mypage-tabs [role="tab"] { font-size: 0.85rem; } }

/* タッチ操作の端末では「マウスを乗せたとき」の見た目が押したあとも残るので、打ち消して、押している間だけ反応させる */
@media (hover: none) {
  .icon-btn:hover, .drawer-close:hover, .mypage-tabs [role="tab"]:hover { background: none; }
  .fav-btn:hover, .watch-btn:hover { border-color: rgba(255, 255, 255, 0.25); }
  .fav-btn[aria-pressed="true"]:hover { border-color: var(--accent); }
  .watch-btn[aria-pressed="true"]:hover { border-color: var(--sale); }
  .remove-btn:hover { border-color: var(--border); color: var(--muted); background: none; }
  .to-top:hover { color: var(--text); }
  .menu-btn:hover { border-color: transparent; }
}
.icon-btn, .fav-btn, .watch-btn, .remove-btn, .mypage-tabs [role="tab"], .bottom-nav a, .to-top { -webkit-tap-highlight-color: transparent; }
.icon-btn:active, .drawer-close:active, .mypage-tabs [role="tab"]:active, .remove-btn:active { background: var(--state-hover); }
.fav-btn:active, .watch-btn:active, .to-top:active { transform: scale(0.92); }
@media (prefers-reduced-motion: reduce) { .fav-btn:active, .watch-btn:active, .to-top:active { transform: none; } }
