:root {
  color-scheme: dark light;
  --color-bg: #0f172a;
  --color-surface: rgba(15, 23, 42, 0.7);
  --color-surface-light: rgba(255, 255, 255, 0.08);
  --color-card: rgba(15, 23, 42, 0.8);
  --color-border: rgba(148, 163, 184, 0.2);
  --color-text: #f8fafc;
  --color-subtle: #cbd5f5;
  --color-accent: #f97316;
  --color-accent-hover: #fb923c;
  --color-badge: #ef4444;
  --color-shadow: rgba(15, 23, 42, 0.45);
  --max-width: 1200px;
  font-family: 'Inter', 'Noto Sans JP', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.4), transparent 55%), #020617;
  color: var(--color-text);
  min-height: 100vh;
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 72px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
}

.page__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.page__subtitle {
  margin: 8px 0 0;
  color: var(--color-subtle);
  font-size: 0.95rem;
}

.page__credit {
  font-size: 0.85rem;
  color: var(--color-subtle);
}

.page__credit a {
  color: var(--color-accent);
  text-decoration: none;
}

.page__credit a:hover {
  text-decoration: underline;
}


.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  row-gap: 10px;
}

@media (max-width: 768px) {
  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .category-tabs__item {
    flex: 0 0 auto;
  }
}

.category-tabs__item {
  position: relative;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.category-tabs__item:hover {
  transform: translateY(-1px);
  background: rgba(59, 130, 246, 0.25);
}

.category-tabs__item.is-active {
  background: rgba(59, 130, 246, 0.4);
  border-color: rgba(59, 130, 246, 0.6);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.summary__metric {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.summary__label {
  font-size: 0.8rem;
  color: var(--color-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.summary__value {
  font-size: 1.3rem;
  font-weight: 600;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button {
  border: none;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 20px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.95rem;
}

.button--primary {
  background: linear-gradient(135deg, var(--color-accent), #fb7185);
  color: #fff;
  box-shadow: 0 10px 25px -12px rgba(249, 115, 22, 0.8);
}

.button--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px -12px rgba(249, 115, 22, 0.95);
}

.button--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.button--ghost:hover,
.category-tabs__item.is-active.button--ghost {
  background: rgba(255, 255, 255, 0.18);
}

.button.is-active {
  background: rgba(244, 114, 182, 0.3);
  border-color: rgba(244, 114, 182, 0.7);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.card {
  background: var(--color-card);
  border-radius: 20px;
  border: 1px solid var(--color-border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 45px -30px var(--color-shadow);
  position: relative;
  overflow: hidden;
}

.card__image-wrapper {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}

.card__image-wrapper img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.card__image-wrapper img:hover {
  transform: scale(1.03);
}

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(239, 68, 68, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.card__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
}

.card__meta {
  margin: 0;
  color: var(--color-subtle);
  font-size: 0.9rem;
}

.card__meta--genre {
  font-size: 0.85rem;
}

.card__pricing {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.card__price {
  font-weight: 600;
  font-size: 1.1rem;
}

.card__price--sale {
  color: #fbbf24;
  font-size: 1.25rem;
}

.card__price--original {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
}

.card__discount {
  background: rgba(59, 130, 246, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

.card__cta {
  margin-top: auto;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination__button {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.pagination__button.is-active {
  background: rgba(59, 130, 246, 0.4);
  border-color: rgba(59, 130, 246, 0.7);
}

.pagination__button.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pagination__button:hover:not(.is-disabled) {
  background: rgba(59, 130, 246, 0.3);
}

.pagination__ellipsis,
.pagination__label {
  color: var(--color-subtle);
  font-size: 0.85rem;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  color: var(--color-subtle);
}

.loading__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(148, 163, 184, 0.3);
  border-top-color: rgba(148, 163, 184, 0.9);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.noscript-warning {
  background: #7f1d1d;
  color: #fee2e2;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid rgba(248, 113, 113, 0.6);
  margin-bottom: 16px;
}

.page__legal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  line-height: 1.7;
}

.page__legal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.page__legal-list {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.page__legal-list > li {
  font-size: 0.95rem;
}

.page__legal-sublist {
  margin: 10px 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: disc;
}

.page__legal-link {
  color: var(--color-accent);
  text-decoration: none;
}

.page__legal-link:hover {
  text-decoration: underline;
}

.page__legal-note {
  margin: 0;
  font-size: 0.8rem;
  color: var(--color-subtle);
  text-align: right;
}

@media (max-width: 768px) {
  .page__legal {
    padding: 20px;
  }
}

.page__footer {
  text-align: center;
  margin-top: 32px;
  color: var(--color-subtle);
  font-size: 0.8rem;
}

.page__footer a {
  color: var(--color-accent);
}

.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 40;
}

.modal[data-open='true'] {
  display: block;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.8);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.95);
  border-radius: 20px;
  padding: 24px;
  max-width: min(860px, 90vw);
  box-shadow: 0 35px 65px -40px rgba(15, 23, 42, 0.9);
}

.modal__content img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 16px;
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: none;
  color: var(--color-text);
  font-size: 1.4rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.modal__thumbnails {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.modal__thumbnail {
  border: 2px solid transparent;
  padding: 2px;
  border-radius: 10px;
  background: none;
  cursor: pointer;
}

.modal__thumbnail img {
  width: 90px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
}

.modal__thumbnail.is-active {
  border-color: rgba(59, 130, 246, 0.6);
}

.age-gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(6px);
  z-index: 50;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.age-gate[data-visible='false'] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.age-gate__panel {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 24px;
  padding: 32px;
  max-width: 420px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 30px 60px -35px rgba(15, 23, 42, 0.9);
  text-align: center;
}

.age-gate__panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
}

.age-gate__panel p {
  color: var(--color-subtle);
  margin-bottom: 20px;
  line-height: 1.6;
}

.age-gate__actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 768px) {
  .page {
    padding: 32px 16px 48px;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .category-tabs {
    justify-content: center;
  }

  .card__image-wrapper img {
    height: 200px;
  }

  .modal__content {
    padding: 18px;
  }

  .modal__content img {
    max-height: 60vh;
  }

  .age-gate__panel {
    margin: 0 16px;
  }
}
