:root {
  --bg: #0f1117;
  --surface: #181b23;
  --surface-hover: #202430;
  --border: #2a3040;
  --text: #eef1f7;
  --muted: #9aa4b8;
  --accent: #3b82f6;
  --dlsite: #052a83;
  --dlsite-light: #3b82f6;
  --fanza: #d91c5c;
  --sale: #ef4444;
  --diff: #f59e0b;
  --radius: 10px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 年齢確認モーダル */
.age-gate {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.age-gate-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-width: 440px;
  width: 100%;
  padding: 28px 24px;
  text-align: center;
}

.age-gate-box h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.age-gate-box p {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.age-gate-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ボタン共通 */
.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  opacity: 0.9;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-secondary {
  background: var(--surface-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  text-decoration: underline;
}

/* ヘッダー */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  margin-bottom: 20px;
}

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

.site-title {
  font-size: 1.3rem;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.8rem;
  color: var(--muted);
}

/* コントロールバー */
.controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.search-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#search-input {
  flex: 1 1 260px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

#sort-select {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

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

.genre-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tab {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.84rem;
  cursor: pointer;
}

.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.toggle-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.result-bar {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ピックアップ枠 */
.featured-section {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 20px;
}

.featured-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

/* 作品グリッド */
.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.work-card:hover {
  transform: translateY(-2px);
  border-color: #3f4860;
}

.thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0a0c10;
  overflow: hidden;
}

.thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  color: #fff;
}

.badge-sale {
  background: var(--sale);
}

.badge-diff {
  background: var(--diff);
  color: #111;
}

.card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

.card-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-list {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 6px;
}

.store-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  transition: opacity 0.15s ease;
}

.store-btn:hover {
  opacity: 0.9;
}

.store-dlsite {
  background: var(--dlsite);
  border: 1px solid var(--dlsite-light);
}

.store-fanza {
  background: var(--fanza);
}

.store-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.base-price {
  font-size: 0.74rem;
  text-decoration: line-through;
  opacity: 0.75;
  font-weight: 400;
}

.cheapest-tag {
  font-size: 0.68rem;
  background: #fbbf24;
  color: #111;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
}

.load-more-wrap {
  text-align: center;
  margin: 28px 0 40px;
}

/* フッター */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 20px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.disclaimer {
  font-size: 0.76rem;
  color: var(--muted);
}