:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --bg-gradient: linear-gradient(135deg, #0d0d0d 0%, #1a0a1a 50%, #0d0d0d 100%);
  --card: #1a1a1a;
  --card-glow: rgba(236, 72, 153, 0.08);
  --text: #f5f5f5;
  --muted: #9ca3af;
  --primary: #ec4899;
  --primary-dark: #db2777;
  --primary-glow: rgba(236, 72, 153, 0.4);
  --secondary: #a855f7;
  --border: #2d2d2d;
  --border-glow: rgba(236, 72, 153, 0.3);
  --good: #22c55e;
  --bad: #ef4444;
  --header-height: 60px;
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
}

[hidden] {
  display: none !important;
}

/* ========================================
   グローバルヘッダー
   ======================================== */

.global-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(13, 13, 13, 0.98);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

.global-header__container {
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.global-header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.global-header__logo:hover {
  transform: scale(1.02);
}

.global-header__icon {
  font-size: 1.6rem;
}

.global-header__title {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.global-header__nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.global-header__back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.global-header__back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(236, 72, 153, 0.1);
}

.global-header__back-icon {
  font-size: 0.9rem;
}

@media (max-width: 600px) {
  .global-header {
    height: 52px;
  }
  
  :root {
    --header-height: 52px;
  }
  
  .global-header__container {
    padding: 0 12px;
  }
  
  .global-header__icon {
    font-size: 1.3rem;
  }
  
  .global-header__title {
    font-size: 1rem;
  }
  
  .global-header__back {
    padding: 6px 12px;
    font-size: 0.8rem;
  }
  
  .global-header__back-text {
    display: none;
  }
}

.age-gate {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(12px);
  padding: 24px;
  z-index: 150;
}

.age-gate__card {
  width: min(520px, 100%);
  background: var(--card);
  border-radius: 20px;
  padding: 36px;
  text-align: center;
  border: 1px solid var(--border-glow);
  box-shadow: 
    0 0 60px var(--primary-glow),
    0 20px 50px rgba(0, 0, 0, 0.5);
}

.age-gate__icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.age-gate__title {
  margin: 0 0 12px;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.age-gate__desc {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.age-gate__actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}

.age-gate__note {
  margin: 0;
  color: var(--bad);
  font-weight: 600;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 12px) 16px 12px;
  gap: 8px;
}

.app__header {
  display: none;
}

.app__eyebrow {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.app__title {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  to { background-position: 200% center; }
}

.app__desc {
  margin: 0;
  color: var(--muted);
}

.card {
  width: min(680px, 100%);
  max-height: calc(100vh - var(--header-height) - 24px);
  max-height: calc(100dvh - var(--header-height) - 24px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 
    0 0 40px var(--card-glow),
    0 20px 40px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--secondary), var(--primary), transparent);
}

.progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: #2d2d2d;
  overflow: hidden;
  flex-shrink: 0;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s ease;
  box-shadow: 0 0 10px var(--primary-glow);
}

.meta {
  margin: 8px 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.question {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  flex-shrink: 0;
}

.question-media {
  margin: 0 0 10px;
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.question-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #1f1f1f;
  display: block;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  object-fit: contain;
}

.question-image:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--primary-glow);
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.choice {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  transition: all 0.25s ease;
}

.choice:hover {
  border-color: var(--primary);
  background: rgba(236, 72, 153, 0.1);
  transform: translateX(4px);
}

.choice.is-selected {
  border-color: var(--primary);
  background: rgba(236, 72, 153, 0.2);
  box-shadow: 0 0 20px var(--primary-glow);
}

.choice.is-correct {
  border-color: var(--good);
  background: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.choice.is-wrong {
  border-color: var(--bad);
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.choice:disabled {
  cursor: default;
  opacity: 0.8;
}

.choice:disabled:hover {
  transform: none;
}

.feedback {
  min-height: 1.2em;
  margin: 8px 0 0;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.feedback.is-correct {
  color: var(--good);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

.feedback.is-wrong {
  color: var(--bad);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-top: 12px;
  flex-shrink: 0;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 20px var(--primary-glow);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--primary-glow);
}

.btn--ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn--affiliate {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.btn--affiliate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.5);
}

.btn--affiliate.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.card--result {
  text-align: center;
}

.result__title {
  margin: 0 0 12px;
  font-size: 1.6rem;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result__score {
  margin: 0;
  font-size: 3rem;
  font-weight: 800;
  color: var(--primary);
  text-shadow: 0 0 30px var(--primary-glow);
}

.result__msg {
  margin: 12px 0 24px;
  color: var(--muted);
  font-size: 1.1rem;
}

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

/* ========================================
   ホーム画面
   ======================================== */

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 40px) 20px 40px;
}

.home__container {
  width: min(900px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.home__header {
  text-align: center;
}

.home__eyebrow {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.home__title {
  margin: 16px 0 12px;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  background: linear-gradient(90deg, var(--primary), var(--secondary), var(--primary));
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
  line-height: 1.2;
}

.home__tagline {
  margin: 0;
  font-size: 1.1rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

.home__hero {
  text-align: center;
}

.home__description {
  margin: 0;
  font-size: 1rem;
  color: var(--muted);
}

.home__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 500px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.3s ease;
}

.stat-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 30px var(--card-glow);
  transform: translateY(-4px);
}

.stat-card--clickable {
  cursor: pointer;
  position: relative;
}

.stat-card--clickable::after {
  content: "▶";
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card--clickable:hover::after {
  opacity: 1;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card__label {
  font-size: 0.85rem;
  color: var(--muted);
}

.home__actions {
  display: flex;
  justify-content: center;
}

.btn--large {
  padding: 20px 48px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn__icon {
  font-size: 1.4rem;
}

.home__footer {
  margin-top: 24px;
  text-align: center;
}

.home__copyright {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  opacity: 0.6;
}

/* 戻るボタン - 非推奨（グローバルヘッダーを使用） */
.back-btn {
  display: none;
}

/* レスポンシブ調整 */
@media (max-width: 600px) {
  .home {
    padding: 40px 16px;
  }

  .home__container {
    gap: 24px;
  }

  .home__stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .stat-card {
    padding: 16px 8px;
  }

  .stat-card__value {
    font-size: 1.5rem;
  }

  .stat-card__label {
    font-size: 0.75rem;
  }

  .btn--large {
    padding: 16px 32px;
    font-size: 1rem;
  }

  .app {
    padding: 8px 12px;
  }

  .card {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .choices {
    gap: 6px;
  }

  .choice {
    padding: 8px 12px;
    font-size: 0.85rem;
    border-radius: 8px;
  }

  .btn {
    padding: 10px 18px;
    font-size: 0.85rem;
  }
}

/* ========================================
   モーダル
   ======================================== */

.modal {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal__backdrop {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal__content {
  position: relative;
  width: min(900px, 100%);
  max-height: 85vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: 
    0 0 60px var(--primary-glow),
    0 20px 60px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal__close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.modal__close:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(236, 72, 153, 0.1);
}

.modal__body {
  padding: 24px 28px;
  overflow-y: auto;
  flex: 1;
}

/* 女優グリッド */
.actress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 20px;
}

.actress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 16px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: all 0.3s ease;
  cursor: default;
}

.actress-card:hover {
  border-color: var(--primary);
  background: rgba(236, 72, 153, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--card-glow);
}

.actress-card__image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  background: #1f1f1f;
  transition: border-color 0.3s ease;
}

.actress-card:hover .actress-card__image {
  border-color: var(--primary);
}

.actress-card__name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.actress-card__count {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
}

/* プレースホルダー画像 */
.actress-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
  font-size: 2rem;
}

@media (max-width: 600px) {
  .modal {
    padding: 12px;
  }

  .modal__content {
    max-height: 90vh;
    border-radius: 20px;
  }

  .modal__header {
    padding: 16px 20px;
  }

  .modal__body {
    padding: 16px 20px;
  }

  .actress-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }

  .actress-card {
    padding: 12px 8px;
  }

  .actress-card__image {
    width: 80px;
    height: 80px;
  }

  .actress-card__name {
    font-size: 0.8rem;
  }
}
