/* ============================================================
   MBTI相性診断SaaS — Mobile-First Purple Theme with Animations
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700;900&display=swap');

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --primary-bg: #F3EDFF;
  --primary-glow: rgba(124, 58, 237, 0.12);

  --navy: #1E1B4B;
  --navy-light: #312E81;
  --navy-dark: #0F0D2E;

  --success: #059669;
  --success-bg: #D1FAE5;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;

  --text: #1E1B4B;
  --text-secondary: #6B7280;
  --text-body: #374151;
  --text-muted: #9CA3AF;

  --bg: #F5F3FF;
  --card: #fff;
  --card-hover: #F9F7FF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);

  --analyst: #88619A;
  --diplomat: #33A474;
  --sentinel: #4298B4;
  --explorer: #E4AE3A;

  --pink: #EC4899;
  --pink-bg: #FDF2F8;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================================
   Animations
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.05); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease-out forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease-out forwards; }
.animate-slideInLeft { animation: slideInLeft 0.5s ease-out forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease-out forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease-out forwards; }
.animate-bounceIn { animation: bounceIn 0.6s ease-out forwards; }

/* Stagger animation delays */
.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }
.stagger-5 { animation-delay: 0.25s; opacity: 0; }
.stagger-6 { animation-delay: 0.3s; opacity: 0; }

/* ============================================================
   Mobile Header (default visible)
   ============================================================ */
.mobile-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(90deg, #0F0D2E 0%, #1E1B4B 50%, #7C3AED 100%);
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.mobile-header-logo {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 11px;
  flex-shrink: 0;
}

.mobile-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

/* ============================================================
   Tab Switcher (default visible on mobile)
   ============================================================ */
.tab-switcher {
  display: flex;
  background: #1E1B4B;
  padding: 8px 12px;
  gap: 8px;
  position: sticky;
  top: 58px;
  z-index: 99;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.25s;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(124,58,237,0.3);
}
.tab-btn:hover { color: #fff; }

/* ============================================================
   Sidebar (hidden by default, shown on desktop)
   ============================================================ */
.sidebar {
  width: 240px;
  background: linear-gradient(180deg, #0F0D2E 0%, #1E1B4B 50%, #7C3AED 100%);
  display: none;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #A78BFA, #7C3AED);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.sidebar-logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}
.sidebar-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.sidebar-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-left-color: #fff;
  font-weight: 600;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-avatar {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.15);
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   Main Content
   ============================================================ */
.main-content {
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.content-area {
  padding: 12px;
  max-width: 980px;
  width: 100%;
}

/* ============================================================
   Hero Banner
   ============================================================ */
.hero-banner {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  animation: fadeIn 0.8s ease-out;
}

.hero-banner img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.hero-banner-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,13,46,0.7) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}

.hero-banner-text {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

/* ============================================================
   Page Header
   ============================================================ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  animation: fadeInUp 0.5s ease-out;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
}

.page-header-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title-icon {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.card-body {
  padding: 16px;
}

/* Section header with colored left bar */
.section-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.04) 0%, transparent 100%);
}

.section-bar::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: var(--radius) 0 0 0;
}

.section-bar-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

/* ============================================================
   MBTI Type Selector
   ============================================================ */
.type-selector-body { padding: 12px; }

.type-group-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
  margin-top: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  display: inline-block;
}
.type-group-label:first-child { margin-top: 0; }

.type-group-analyst { background: #F3E8F9; color: #88619A; }
.type-group-diplomat { background: #E8F8EF; color: #33A474; }
.type-group-sentinel { background: #E8F4FA; color: #4298B4; }
.type-group-explorer { background: #FDF4E3; color: #E4AE3A; }

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.type-btn {
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.type-btn:hover, .type-btn:active {
  border-color: var(--primary-light);
  background: var(--primary-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

.type-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
  animation: pulse 0.3s ease-out;
}

.type-btn-sub {
  display: block;
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
  margin-top: 2px;
}

.type-btn.active .type-btn-sub { opacity: 0.9; }

/* ============================================================
   Result: Type Profile
   ============================================================ */
.type-profile {
  padding: 16px;
}

.type-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.type-profile-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  animation: bounceIn 0.5s ease-out;
  flex-shrink: 0;
}

.type-profile-info h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--navy);
  line-height: 1.2;
}

.type-profile-nickname {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.type-profile-group {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.type-profile-traits {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.trait-tag {
  padding: 4px 12px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  animation: fadeInUp 0.4s ease-out both;
}

.type-profile-desc {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-body);
  padding: 12px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  animation: slideInLeft 0.5s ease-out;
}

/* ============================================================
   Result Sections (animated)
   ============================================================ */
.result-section {
  margin-bottom: 16px;
  animation: fadeInUp 0.5s ease-out both;
}

.result-list {
  list-style: none;
  padding: 0;
}

.result-list li {
  padding: 10px 16px 10px 32px;
  font-size: 13px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  transition: background 0.2s;
}
.result-list li:last-child { border-bottom: none; }
.result-list li:hover, .result-list li:active { background: var(--card-hover); }

.result-list li::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary-light);
}

.result-list.strength li::before { background: var(--success); }
.result-list.weakness li::before { background: var(--danger); }
.result-list.tip li::before { background: #3B82F6; }
.result-list.caution li::before { background: var(--warning); }
.result-list.ng li::before { background: var(--danger); }
.result-list.crush li::before { background: var(--pink); }
.result-list.dating li::before { background: var(--pink); }

/* ============================================================
   Love Section
   ============================================================ */
.love-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px 16px;
}

.love-item {
  padding: 12px 14px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
  transition: transform 0.2s;
}

.love-item:active {
  transform: scale(0.98);
}

.love-item-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.love-item-text {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.8;
}

/* ============================================================
   LINE Section
   ============================================================ */
.line-examples {
  padding: 12px 16px;
}

.line-example-item {
  padding: 10px 14px;
  background: #E8F5E9;
  border-radius: 16px 16px 16px 4px;
  margin-bottom: 8px;
  font-size: 13px;
  color: #2E7D32;
  display: inline-block;
  max-width: 90%;
  animation: slideInLeft 0.4s ease-out both;
  transition: transform 0.2s;
}

.line-example-item:nth-child(2) { animation-delay: 0.1s; }
.line-example-item:nth-child(3) { animation-delay: 0.2s; }
.line-example-item:active { transform: scale(0.97); }

/* ============================================================
   Crush Signs & Dating Tips
   ============================================================ */
.crush-signs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px 16px;
}

.crush-sign-item {
  padding: 10px 14px;
  background: var(--pink-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--pink);
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.7;
  transition: transform 0.2s;
}

.crush-sign-item:active { transform: scale(0.98); }

/* ============================================================
   Compatibility Section
   ============================================================ */
.compat-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px 16px;
}

.compat-item {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fff;
  transition: transform 0.2s;
}
.compat-item:active { transform: scale(0.98); }

.compat-item-level {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.compat-item.best { border-color: #FCA5A5; background: #FFF5F5; }
.compat-item.best .compat-item-level { color: #DC2626; }
.compat-item.good { border-color: #FCD34D; background: #FFFBEB; }
.compat-item.good .compat-item-level { color: #D97706; }
.compat-item.normal { border-color: #93C5FD; background: #EFF6FF; }
.compat-item.normal .compat-item-level { color: #2563EB; }
.compat-item.bad { border-color: #D1D5DB; background: #F9FAFB; }
.compat-item.bad .compat-item-level { color: #6B7280; }

.compat-types {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.compat-type-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.compat-type-tag:hover, .compat-type-tag:active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
  transform: scale(1.05);
}

/* ============================================================
   Caution Section
   ============================================================ */
.caution-list {
  list-style: none;
  padding: 0;
}

.caution-list li {
  padding: 10px 16px 10px 38px;
  font-size: 13px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-light);
  position: relative;
  line-height: 1.8;
}
.caution-list li:last-child { border-bottom: none; }
.caution-list li:hover, .caution-list li:active { background: var(--card-hover); }

.caution-list li::before {
  content: '!';
  position: absolute;
  left: 10px;
  top: 10px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================================
   Character Cards
   ============================================================ */
.character-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 12px 16px;
}

.character-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: all 0.25s;
}
.character-card:hover, .character-card:active {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124,58,237,0.1);
}

.character-img {
  width: 52px; height: 52px;
  border-radius: 50%;
  margin-bottom: 8px;
  background: var(--border);
}

.character-info { text-align: center; }

.character-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.character-source {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Character mini (pair comparison) */
.character-card-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
}
.character-card-mini:last-child { border-bottom: none; }

.character-img-mini {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.character-name-mini {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.character-source-mini {
  font-size: 10px;
  color: var(--text-muted);
}

/* Scene images (group illustrations) */
.scene-images {
  padding: 12px 16px;
}

.scene-img {
  width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* Section Scene Image (between sections) */
.section-scene-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  margin: 4px 0;
  animation: fadeIn 0.6s ease-out;
}

.section-scene-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  border-radius: var(--radius);
  transition: transform 0.3s;
}

.section-scene-wrap:hover .section-scene-img {
  transform: scale(1.02);
}

/* Image Gallery (multiple images in a row) */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 4px 0;
}

.image-gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  animation: scaleIn 0.5s ease-out both;
}

.image-gallery-item:nth-child(2) { animation-delay: 0.1s; }
.image-gallery-item:nth-child(3) { animation-delay: 0.2s; }
.image-gallery-item:nth-child(4) { animation-delay: 0.3s; }

.image-gallery-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.image-gallery-item:hover img {
  transform: scale(1.05);
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-neutral { background: #F3F4F6; color: var(--text-secondary); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-pink { background: var(--pink-bg); color: var(--pink); }

/* ============================================================
   Pair Selector
   ============================================================ */
.pair-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.pair-select-box { width: 100%; }

.pair-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.pair-select {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  appearance: auto;
  min-height: 44px;
}
.pair-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.pair-vs {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  flex-shrink: 0;
  animation: heartbeat 1.5s ease-in-out infinite;
}

.pair-check-btn {
  width: 100%;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.25s;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.pair-check-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}
.pair-check-btn:active:not(:disabled) {
  transform: scale(0.98);
}
.pair-check-btn:disabled {
  background: #D1D5DB;
  cursor: not-allowed;
}

/* ============================================================
   Pair Result Header
   ============================================================ */
.pair-header {
  padding: 20px 16px;
  text-align: center;
}

.pair-header-types {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.pair-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.pair-type-card:hover, .pair-type-card:active {
  background: var(--card-hover);
}

.pair-type-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fff;
  animation: bounceIn 0.5s ease-out;
}

.pair-type-name {
  font-size: 16px;
  font-weight: 900;
  color: var(--navy);
}

.pair-type-nick {
  font-size: 11px;
  color: var(--text-muted);
}

.pair-vs-large {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border-radius: var(--radius);
  animation: scaleIn 0.5s ease-out;
}

.pair-vs-stars {
  font-size: 18px;
  line-height: 1;
}

.pair-vs-label {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.pair-level-best { background: #FFF5F5; }
.pair-level-best .pair-vs-stars { color: #EF4444; }
.pair-level-best .pair-vs-label { color: #DC2626; }

.pair-level-good { background: #FFFBEB; }
.pair-level-good .pair-vs-stars { color: #F59E0B; }
.pair-level-good .pair-vs-label { color: #D97706; }

.pair-level-normal { background: #EFF6FF; }
.pair-level-normal .pair-vs-stars { color: #3B82F6; }
.pair-level-normal .pair-vs-label { color: #2563EB; }

.pair-level-bad { background: #F9FAFB; }
.pair-level-bad .pair-vs-stars { color: #9CA3AF; }
.pair-level-bad .pair-vs-label { color: #6B7280; }

.pair-summary {
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-body);
  padding: 14px 16px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  text-align: left;
  animation: slideInLeft 0.5s ease-out;
}

/* Pair Characters Compare */
.pair-characters-compare {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.pair-char-col {
  padding: 12px 16px;
}
.pair-char-col:first-child {
  border-bottom: 1px solid var(--border);
}

.pair-char-col-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* ============================================================
   Auth
   ============================================================ */
body:not(.auth-ready) .main-content {
  opacity: 0;
  pointer-events: none;
}
body.auth-ready .main-content {
  opacity: 1;
  transition: opacity 0.3s;
}

/* ============================================================
   Footer
   ============================================================ */
footer {
  padding: 20px 16px;
  text-align: left;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}
footer p { margin-bottom: 2px; }

/* ============================================================
   Scroll Reveal Animation
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   Shimmer Loading Effect
   ============================================================ */
.shimmer {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   Pair Detail Sections
   ============================================================ */
.pair-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 12px 16px;
}

.pair-detail-item {
  padding: 12px 14px;
  background: #F9FAFB;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary-light);
}

.pair-detail-label {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
}

.pair-detail-text {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.8;
}

/* ============================================================
   Desktop Styles (min-width: 768px)
   ============================================================ */
@media (min-width: 768px) {
  body { display: flex; }

  .sidebar { display: flex; }
  .mobile-header { display: none; }
  .tab-switcher { display: none; }

  .main-content { margin-left: 240px; }

  .content-area {
    padding: 36px;
  }

  .page-header h1 { font-size: 22px; }

  .type-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .compat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero-banner img {
    height: 220px;
  }

  .type-profile { padding: 24px; }

  .type-profile-icon {
    width: 64px; height: 64px;
    font-size: 24px;
  }

  .type-profile-info h2 { font-size: 22px; }

  .love-grid { padding: 16px 20px; }
  .result-list li { padding-left: 36px; }
  .caution-list li { padding-left: 40px; }

  .pair-selector {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .pair-select-box { flex: 1; }
  .pair-vs { padding-top: 20px; }

  .pair-header { padding: 28px 24px; }
  .pair-header-types { gap: 20px; }

  .pair-type-icon {
    width: 56px; height: 56px;
    font-size: 20px;
  }

  .pair-type-name { font-size: 18px; }

  .pair-summary { max-width: 700px; margin: 0 auto; }

  .crush-signs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .pair-detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card { margin-bottom: 20px; }
  .section-bar { padding: 14px 20px; }

  footer {
    padding: 24px 36px;
    font-size: 12px;
  }
}

/* あるあるグリッド */
.aruaru-grid {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aruaru-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #FAF5FF 0%, #FDF2F8 100%);
  border-radius: 12px;
  border-left: 3px solid #7C3AED;
  font-size: 13px;
  line-height: 1.7;
  animation: fadeInUp 0.4s ease-out both;
}

.aruaru-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #7C3AED;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

.aruaru-text {
  flex: 1;
}

/* レーダーチャート */
.radar-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.radar-canvas {
  width: 280px;
  height: 280px;
}

.radar-scores {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.radar-score-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.radar-score-label {
  font-size: 12px;
  font-weight: 700;
  width: 50px;
  text-align: right;
  flex-shrink: 0;
}

.radar-score-bar-bg {
  flex: 1;
  height: 10px;
  background: #F3F4F6;
  border-radius: 5px;
  overflow: hidden;
}

.radar-score-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.8s ease-out;
}

.radar-score-num {
  font-size: 16px;
  font-weight: 800;
  width: 30px;
  text-align: right;
  flex-shrink: 0;
}

/* ペアレーダーチャート */
.pair-radar-wrap {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.pair-radar-legend {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.pair-radar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.pair-radar-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.pair-radar-canvas {
  width: 300px;
  height: 300px;
}

.pair-radar-compare {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pair-radar-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pair-radar-val {
  font-size: 13px;
  font-weight: 800;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.pair-radar-label {
  font-size: 11px;
  font-weight: 700;
  color: #6B7280;
  width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.pair-radar-bar-wrap {
  flex: 1;
  height: 8px;
  background: #F3F4F6;
  border-radius: 4px;
  overflow: hidden;
}

.pair-radar-bar-l {
  height: 100%;
  border-radius: 4px;
  float: right;
}

.pair-radar-bar-r {
  height: 100%;
  border-radius: 4px;
}

/* 仕事・適職 */
.work-section { padding-bottom: 8px; }

.work-style-text {
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.8;
  color: #374151;
}

.ideal-job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px 12px;
}

.ideal-job-tag {
  background: linear-gradient(135deg, #EEF2FF 0%, #F0F9FF 100%);
  color: #2563EB;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #BFDBFE;
}

/* 座右の銘 */
.motto-wrap {
  margin: 12px 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #FDF2F8 0%, #FAF5FF 100%);
  border-radius: 12px;
  text-align: center;
  border: 1px solid #F5D0FE;
}

.motto-label {
  font-size: 11px;
  font-weight: 700;
  color: #9333EA;
  margin-bottom: 6px;
}

.motto-text {
  font-size: 16px;
  font-weight: 800;
  color: #7C3AED;
  line-height: 1.6;
}

.life-section { padding-bottom: 8px; }

@media (min-width: 768px) {
  .radar-wrap {
    flex-direction: row;
    justify-content: center;
    padding: 20px 24px;
    gap: 28px;
  }
  .radar-canvas { width: 300px; height: 300px; }
  .radar-scores { max-width: 280px; }

  .pair-radar-wrap { padding: 20px 24px; }
  .pair-radar-canvas { width: 320px; height: 320px; }
  .pair-radar-compare { max-width: 450px; }

  .aruaru-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 20px;
  }
}

@media (min-width: 1024px) {
  .type-profile-header {
    gap: 20px;
  }

  .section-scene-img {
    height: 200px;
  }

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

  .image-gallery-item img {
    height: 160px;
  }
}

/* ============================================================
   Remaining Badge (残り回数)
   ============================================================ */
.remaining-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s;
}
.remaining-badge:hover { transform: scale(1.05); }
.remaining-badge.free {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  color: #92400E;
  border: 1px solid #F59E0B;
}
.remaining-badge.pro {
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  color: #fff;
  border: none;
}

/* ============================================================
   Paywall Modal
   ============================================================ */
.paywall-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.paywall-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: slideUp 0.4s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.paywall-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #9CA3AF;
  cursor: pointer;
  line-height: 1;
}
.paywall-close:hover { color: #374151; }

.paywall-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.paywall-title {
  font-size: 20px;
  font-weight: 800;
  color: #1F2937;
  margin: 0 0 8px;
}

.paywall-desc {
  font-size: 13px;
  color: #6B7280;
  line-height: 1.7;
  margin: 0 0 20px;
}

.paywall-price {
  background: linear-gradient(135deg, #FAF5FF, #FDF2F8);
  border-radius: 16px;
  padding: 20px 16px;
  margin-bottom: 20px;
}

.paywall-price-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #7C3AED;
  margin-bottom: 4px;
}

.paywall-price-amount {
  display: block;
  font-size: 36px;
  font-weight: 900;
  color: #1F2937;
  line-height: 1.2;
}

.paywall-price-note {
  display: block;
  font-size: 11px;
  color: #9CA3AF;
  margin-top: 4px;
}

.paywall-features {
  text-align: left;
  margin-bottom: 20px;
}

.paywall-feature-item {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 13px;
  color: #374151;
  border-bottom: 1px solid #F3F4F6;
}

.paywall-feature-item::before {
  content: '✓';
  position: absolute;
  left: 4px;
  color: #059669;
  font-weight: 700;
}

.paywall-buy-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7C3AED, #EC4899);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(124,58,237,0.4);
}
.paywall-buy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(124,58,237,0.5);
}
.paywall-buy-btn:active {
  transform: translateY(0);
}

.paywall-remaining {
  margin-top: 12px;
  font-size: 12px;
  color: #9CA3AF;
}

/* ============================================================
   CROSS: MBTI × ラブタイプ 掛け合わせ診断
   ============================================================ */
.cross-header { text-align: center; padding: 24px 16px; }
.cross-header-types { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.cross-type-card { text-align: center; min-width: 100px; }
.cross-type-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 14px; margin: 0 auto 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.cross-type-name { font-weight: 700; font-size: 15px; color: #1F2937; }
.cross-type-nick { font-size: 12px; color: #6B7280; margin-top: 2px; }
.cross-multiply { font-size: 36px; font-weight: 900; background: linear-gradient(135deg, #6366F1, #E91E63); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
/* ペルソナ（一言でいうと） */
.cross-persona { margin-top: 8px; padding: 20px; background: linear-gradient(135deg, #EDE9FE, #FCE7F3); border-radius: 16px; }
.cross-persona-label { font-size: 11px; color: #9CA3AF; font-weight: 700; letter-spacing: 0.1em; margin-bottom: 4px; }
.cross-persona-title { font-size: 22px; font-weight: 900; background: linear-gradient(135deg, #6366F1, #E91E63); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; line-height: 1.4; margin-bottom: 8px; }
.cross-persona-catchcopy { font-size: 13px; color: #7C3AED; font-weight: 600; margin-bottom: 8px; }
.cross-persona-desc { font-size: 13px; color: #4B5563; line-height: 1.7; }

/* 4軸マトリクス */
.cross-matrix { overflow-x: auto; padding: 12px; }
.cross-matrix-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 500px; }
.cross-matrix-table th { background: linear-gradient(135deg, #6366F1, #7C3AED); color: #fff; padding: 10px 8px; text-align: left; font-size: 11px; font-weight: 700; white-space: nowrap; }
.cross-matrix-table td { padding: 10px 8px; border-bottom: 1px solid #F3F4F6; vertical-align: top; line-height: 1.5; }
.cross-matrix-table tbody tr:hover { background: #F9FAFB; }
.cross-matrix-axis { font-weight: 700; white-space: nowrap; }
.cross-axis-badge { display: inline-block; background: #6366F1; color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 900; margin-right: 6px; }
.cross-matrix-combo { color: #7C3AED; font-weight: 600; }

/* 全体マトリクス（16×9） */
.cross-full-matrix-wrap { overflow-x: auto; padding: 12px; }
.cross-full-matrix { border-collapse: collapse; font-size: 11px; width: 100%; min-width: 600px; }
.cross-full-matrix th, .cross-full-matrix td { padding: 6px 4px; text-align: center; border: 1px solid #E5E7EB; }
.cross-full-matrix thead th { background: linear-gradient(135deg, #E91E63, #EC4899); color: #fff; font-weight: 700; font-size: 10px; white-space: nowrap; position: sticky; top: 0; }
.cross-fm-type { font-weight: 900; font-size: 11px; color: #374151; background: #F9FAFB; position: sticky; left: 0; z-index: 1; white-space: nowrap; }
.cross-fm-cell { cursor: pointer; transition: all 0.15s; font-size: 10px; }
.cross-fm-cell:hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,0.15); z-index: 2; position: relative; }
.cross-fm-current { outline: 3px solid #7C3AED; outline-offset: -2px; font-weight: 900; }
.cross-fm-selected { font-weight: 900; }
.cross-fm-row-selected td { border-top: 2px solid #6366F1; border-bottom: 2px solid #6366F1; }
.cross-fm-legend { display: flex; gap: 12px; justify-content: center; padding: 12px; flex-wrap: wrap; font-size: 11px; color: #6B7280; }
.cross-fm-legend-item { display: flex; align-items: center; gap: 4px; }
.cross-fm-dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid #D1D5DB; }

@media (max-width: 768px) {
  .cross-matrix-table { font-size: 11px; }
  .cross-full-matrix { font-size: 9px; }
  .cross-full-matrix th, .cross-full-matrix td { padding: 4px 2px; }
  .cross-type-icon { width: 44px; height: 44px; font-size: 11px; }
  .cross-multiply { font-size: 28px; }
}
