: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;
}

.service-switcher {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  margin: -48px -24px 24px;
  padding: 0 24px;
}

.service-switcher__container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: 4px;
}

.service-switcher__link {
  padding: 12px 20px;
  color: var(--color-subtle);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s;
  font-weight: 600;
  font-size: 0.95rem;
}

.service-switcher__link:hover {
  color: var(--color-text);
}

.service-switcher__link.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

@media (max-width: 768px) {
  .service-switcher {
    margin: -32px -16px 16px;
    padding: 0 16px;
  }
  
  .service-switcher__link {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
}


.category-selector {
  display: none;
}

.category-selector__dropdown {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="%23CBD5F5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 44px;
}

.category-selector__dropdown:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.7);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

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

@media (max-width: 768px) {
  .category-selector {
    display: block;
    margin-bottom: 16px;
  }

  .category-tabs {
    display: none;
  }
}

.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;
}

.controls__info {
  flex: 1;
  min-width: 200px;
}

.controls__count {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.controls__actions {
  display: flex;
  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(1200px, 95vw);
  max-height: 95vh;
  box-shadow: 0 35px 65px -40px rgba(15, 23, 42, 0.9);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal__image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}

.modal__content img {
  width: 100%;
  height: 100%;
  max-height: 75vh;
  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;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  flex-shrink: 0;
}

.modal__thumbnails::-webkit-scrollbar {
  height: 6px;
}

.modal__thumbnails::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.modal__thumbnails::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

.modal__thumbnail {
  border: 2px solid transparent;
  padding: 2px;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.2s, transform 0.2s;
}

.modal__thumbnail:hover {
  transform: scale(1.05);
}

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

.modal__thumbnail.is-active {
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.3);
}

.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;
  }

  .controls__info {
    text-align: center;
    min-width: unset;
  }

  .controls__count {
    font-size: 0.85rem;
  }

  .controls__actions {
    justify-content: center;
  }

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

  .modal__content {
    padding: 12px;
    max-width: 98vw;
    max-height: 95vh;
    border-radius: 12px;
  }

  .modal__image-container {
    flex: 1;
    min-height: 0;
  }

  .modal__content img {
    max-height: 80vh;
    width: 100%;
    height: auto;
  }

  .modal__thumbnails {
    margin-top: 12px;
    padding: 6px 0;
  }

  .modal__thumbnail {
    padding: 1px;
  }

  .modal__thumbnail img {
    width: 60px;
    height: 80px;
  }

  .modal__close {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    top: 8px;
    right: 8px;
  }

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

/* Image Placeholder & Loading */
.card__image-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 0%, rgba(51, 65, 85, 0.8) 50%, rgba(30, 41, 59, 0.8) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-subtle);
  font-size: 0.875rem;
}

.card__image-placeholder.error {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.card__image {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.card__image.loaded {
  opacity: 1;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Error Message */
.error-message {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  animation: slideDown 0.3s ease-out;
}

.error-message__content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.error-message__icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.error-message__text {
  flex: 1;
  margin: 0;
  color: #fca5a5;
  font-weight: 500;
  min-width: 200px;
}

.error-message__retry {
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.error-message__retry:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

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

/* Performance: Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Cache optimization hints */
.card__image-wrapper img {
  will-change: opacity;
}

.modal__content {
  will-change: transform;
}

/* FAQ Page Styles */
.faq-page {
  max-width: 900px;
}

.breadcrumb {
  margin-bottom: 24px;
}

.breadcrumb__list {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb__item {
  display: flex;
  align-items: center;
  color: var(--color-subtle);
  font-size: 0.875rem;
}

.breadcrumb__item:not(:last-child)::after {
  content: '›';
  margin-left: 8px;
  color: var(--color-border);
}

.breadcrumb__link {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb__link:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

.faq-section {
  margin-bottom: 48px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-item {
  background: var(--color-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.faq-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--color-shadow);
}

.faq-item__question {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--color-text);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.faq-item__number {
  color: var(--color-accent);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-item__answer {
  color: var(--color-subtle);
  line-height: 1.7;
  margin: 0;
}

.faq-item__answer p {
  margin: 0;
}

.faq-contact {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(251, 146, 60, 0.1));
  border: 1px solid rgba(249, 115, 22, 0.3);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
}

.faq-contact__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--color-text);
}

.faq-contact__text {
  color: var(--color-subtle);
  margin: 0 0 24px;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .faq-item {
    padding: 20px;
  }
  
  .faq-item__question {
    font-size: 1rem;
    gap: 8px;
  }
  
  .faq-contact {
    padding: 24px 20px;
  }
  
  .faq-contact__title {
    font-size: 1.25rem;
  }
}
