:root {
  --ink: #16171a;
  --muted: #646b76;
  --line: #d9dde4;
  --paper: #f8f9fb;
  --panel: #ffffff;
  --accent: #d4145a;
  --accent-dark: #9d103f;
  --teal: #007b83;
  --gold: #c8891d;
  --shadow: 0 16px 40px rgba(22, 23, 26, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Arial, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  background: var(--paper);
  letter-spacing: 0;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

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

button,
input,
select {
  font: inherit;
}

button,
select,
a.primary-link {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(248, 249, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: var(--accent);
  border-radius: 6px;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

nav a:hover {
  color: var(--ink);
}

.affiliate-notice {
  width: min(1180px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--panel);
  border-left: 3px solid var(--accent);
  font-size: 14px;
  line-height: 1.5;
}

.affiliate-notice strong {
  margin-right: 6px;
  color: var(--ink);
}

.affiliate-notice strong::after {
  content: "・";
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 40px;
  min-height: 270px;
  padding: 44px 0 32px;
}

.hero-copy h1 {
  max-width: 760px;
  margin: 12px 0 18px;
  font-size: 48px;
  line-height: 1.15;
}

.hero-title-line {
  display: block;
}

.hero-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.search-panel {
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel label {
  display: block;
  margin-bottom: 10px;
  font-weight: 800;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.search-row input,
select {
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}

button,
.primary-link {
  display: inline-grid;
  place-items: center;
  min-height: 44px;
  padding: 0 16px;
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 6px;
  font-weight: 800;
}

.filter-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-row {
  margin-top: 14px;
}

.filter-chip,
.tag {
  min-height: 34px;
  padding: 0 12px;
  color: var(--ink);
  background: #eef1f5;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.filter-chip.is-active {
  color: #fff;
  background: var(--accent);
}

.home-sidebar-search.search-panel {
  display: grid;
  gap: 14px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.home-sidebar-search .search-row {
  grid-template-columns: 1fr;
}

.home-sidebar-search input,
.home-sidebar-search select {
  width: 100%;
}

.home-sidebar-search label {
  margin: 0 0 -4px;
}

.home-quick-filter {
  min-width: 0;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.home-quick-filter legend {
  margin-bottom: 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
}

.home-quick-filter .filter-row {
  margin-top: 0;
}

.home-filter-menus {
  display: grid;
  gap: 10px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.home-catalog-layout {
  min-width: 0;
}

.home-results-toolbar {
  margin-bottom: 22px;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  margin-bottom: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.home-topic-header {
  max-width: 780px;
  padding: 22px 0 18px;
}

.home-topic-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.3;
}

.home-topic-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.metric-strip div {
  padding: 20px;
  background: var(--panel);
}

.metric-strip strong {
  display: block;
  font-size: 25px;
}

.metric-strip span {
  color: var(--muted);
  font-size: 13px;
}

.content-grid {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}

.sidebar section {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar h2,
.section-heading h2 {
  margin: 4px 0 0;
}

.link-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.filter-dropdown {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.filter-dropdown.is-active {
  border-color: var(--accent);
}

.filter-dropdown summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 34px 10px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 800;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown summary::after {
  content: "";
  position: absolute;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.filter-dropdown[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.filter-dropdown summary > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.filter-dropdown-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.filter-dropdown .link-list {
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

.category-count {
  min-width: 24px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eef1f5;
  color: var(--ink);
  text-align: center;
  font-size: 11px;
  font-weight: 800;
}

.all-genres-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.work-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.cover-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.cover-link:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.cover {
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  min-height: 238px;
  padding: 16px;
  color: #fff;
  background:
    linear-gradient(160deg, rgba(22, 23, 26, 0.1), rgba(22, 23, 26, 0.78)),
    var(--cover-color, #007b83);
}

.cover::before {
  content: "";
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  z-index: 1;
}

.cover.has-image {
  background: #17191d;
}

.cover.has-image::before {
  inset: 0;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, transparent 52%, rgba(16, 18, 22, 0.78) 100%);
}

.cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cover span {
  position: relative;
  z-index: 2;
  font-weight: 800;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  min-height: 48px;
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.5;
}

.work-title-link {
  display: -webkit-box;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.work-title-link:hover,
.work-title-link:focus-visible {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.card-signals {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-height: 24px;
  margin: -4px 0 12px;
  font-size: 12px;
}

.card-review {
  color: var(--muted);
  font-weight: 700;
}

.genre-chips {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 5px;
  min-height: 26px;
  margin: 0 0 14px;
}

.genre-chips a {
  padding: 4px 6px;
  border-radius: 4px;
  background: #eef1f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
}

.genre-chips a:hover,
.genre-chips a:focus-visible {
  background: #dcebed;
  color: var(--accent);
}

.genre-chip-more {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr;
}

.card-actions .primary-link {
  background: var(--accent);
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  margin-top: 24px;
}

.pagination:empty {
  display: none;
}

.pagination button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
}

.pagination button:hover:not(:disabled),
.pagination button:focus-visible,
.pagination button.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pagination-summary {
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pagination-gap {
  color: var(--muted);
}

.ranking {
  padding: 54px 0 72px;
}

.ranking-card {
  position: relative;
}

.ranking-position {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  background: var(--gold);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(22, 23, 26, 0.25);
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.feature-list article {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feature-list span {
  color: var(--gold);
  font-weight: 900;
}

.feature-list p {
  color: var(--muted);
  line-height: 1.7;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 23, 26, 0.72);
}

body > .age-gate:not(.is-hidden) ~ *:not(script) {
  visibility: hidden;
}

.age-gate.is-hidden {
  display: none;
}

.age-gate :focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #0b7f86;
  outline-offset: 3px;
}

.age-panel {
  width: min(760px, 100%);
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.age-panel {
  padding: 32px;
}

.age-panel .age-title {
  margin: 8px 0 12px;
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.45;
}

.age-title-break {
  display: none;
}

.age-panel p {
  color: var(--muted);
  line-height: 1.8;
}

.age-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.age-actions button {
  background: var(--accent);
}

footer {
  padding: 28px 16px 44px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-links {
  justify-content: center;
  margin-top: 10px;
}

.footer-links a {
  color: var(--accent);
  font-weight: 700;
}

.policy-page {
  padding: 28px 0 72px;
}

.policy-content {
  max-width: 820px;
  margin: 24px auto 0;
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.policy-content h1 {
  margin: 8px 0 30px;
  font-size: clamp(30px, 5vw, 46px);
}

.policy-content section + section {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.policy-content h2 {
  margin: 0 0 10px;
  font-size: 20px;
}

.policy-content p {
  color: var(--muted);
  line-height: 1.9;
}

.policy-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  nav {
    flex-wrap: wrap;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 36px;
  }

  .sidebar {
    position: static;
  }

  .card-grid,
  .feature-list,
  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 560px) {
  main {
    width: min(100% - 20px, 1180px);
  }

  .search-row,
  .card-grid,
  .feature-list,
  .metric-strip {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 32px;
  }

  .section-heading,
  .age-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .policy-content {
    padding: 22px 18px;
  }

  .age-panel {
    padding: 26px;
  }

  .age-panel .age-title {
    font-size: 26px;
  }

  .age-title-break {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
