/* ========================================
   体内ブラック企業 栄養素診断アプリ
   style.css
   ======================================== */

/* ----- リセット & 基本 ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f0f1a;
  --card:      #1a1a2e;
  --card2:     #16213e;
  --border:    #2a2a4a;
  --accent:    #7c3aed;
  --accent2:   #a855f7;
  --danger:    #dc2626;
  --yes:       #16a34a;
  --no:        #6b7280;
  --text:      #f1f5f9;
  --text-muted:#94a3b8;
  --highlight: #fbbf24;
  --radius:    16px;
  --shadow:    0 8px 32px rgba(0,0,0,0.5);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(124,58,237,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(220,38,38,0.10) 0%, transparent 50%);
}

/* ----- 画面切替 ----- */
.screen { display: none; width: 100%; max-width: 480px; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }

/* ========================================
   SCREEN 1: スタート
   ======================================== */
.start-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 28px 32px;
  text-align: center;
  box-shadow: var(--shadow);
}

.logo-badge {
  display: inline-block;
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
}
.logo-badge.small { font-size: 0.68rem; margin-bottom: 12px; }

.main-title {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #fff 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 28px;
}
.highlight { color: var(--highlight); font-weight: 700; -webkit-text-fill-color: var(--highlight); }

.char-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.char-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.q-count-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.btn-start {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 18px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
}
.btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(124,58,237,0.6); }
.btn-start:active { transform: translateY(0); }

.disclaimer {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 16px;
  opacity: 0.7;
}

/* ========================================
   SCREEN 2: クイズ
   ======================================== */
.quiz-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.progress-wrap { margin-bottom: 24px; }
.progress-label {
  display: flex;
  justify-content: flex-end;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4,0,0.2,1);
  width: 0%;
}

.question-card {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  margin-bottom: 24px;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.q-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 99px;
  align-self: flex-start;
}

.q-text {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.65;
  flex: 1;
}

.q-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.answer-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-yes, .btn-no {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 12px;
  padding: 18px 8px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-yes { background: linear-gradient(135deg, #15803d, var(--yes)); color: #fff; box-shadow: 0 4px 16px rgba(22,163,74,0.35); }
.btn-no  { background: linear-gradient(135deg, #4b5563, var(--no)); color: #fff; box-shadow: 0 4px 16px rgba(107,114,128,0.25); }
.btn-yes:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(22,163,74,0.5); }
.btn-no:hover  { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(107,114,128,0.4); }
.btn-yes:active, .btn-no:active { transform: translateY(0); }

.btn-icon { font-size: 1.5rem; line-height: 1; }
.btn-label { font-size: 0.9rem; text-align: center; line-height: 1.4; }
.btn-label small { font-size: 0.7rem; font-weight: 400; opacity: 0.85; }

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.78rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.15s, color 0.15s;
}
.btn-back:hover { background: var(--border); color: var(--text); }
.btn-back:disabled { opacity: 0.3; cursor: not-allowed; }

/* ========================================
   SCREEN 3: 結果
   ======================================== */
.result-inner {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow);
}

.result-header { text-align: center; margin-bottom: 28px; }
.result-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.result-subtitle { font-size: 0.88rem; color: var(--text-muted); line-height: 1.6; }

/* 結果カード */
.result-cards { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }

.result-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 16px;
  animation: slideIn 0.4s ease both;
}
.result-card:nth-child(1) { animation-delay: 0.05s; }
.result-card:nth-child(2) { animation-delay: 0.15s; }
.result-card:nth-child(3) { animation-delay: 0.25s; }
@keyframes slideIn { from { opacity:0; transform:translateX(-12px); } to { opacity:1; transform:none; } }

.result-card.rank-1 { border-color: var(--highlight); box-shadow: 0 0 20px rgba(251,191,36,0.15); }
.result-card.rank-2 { border-color: var(--accent);   box-shadow: 0 0 12px rgba(124,58,237,0.1); }

.card-rank {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
}
.rank-1 .card-rank { color: var(--highlight); }
.rank-2 .card-rank { color: var(--accent2); }

.card-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
  letter-spacing: -0.04em;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.card-info { flex: 1; min-width: 0; }
.card-name { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.card-role { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 6px; }
.card-status {
  display: inline-block;
  background: rgba(220,38,38,0.2);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.3);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 99px;
  margin-bottom: 8px;
}
.card-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.55; }

/* All Clear */
.result-all-clear {
  text-align: center;
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 20px;
  margin-bottom: 28px;
}
.all-clear-icon { font-size: 3rem; margin-bottom: 12px; }
.result-all-clear h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.result-all-clear p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ブログリンク */
.result-cta {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.cta-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.blog-links { display: flex; flex-direction: column; gap: 8px; }

.blog-link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.blog-link-item:hover { border-color: var(--accent); background: rgba(124,58,237,0.08); }
.blog-link-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.blog-link-text { font-size: 0.82rem; color: var(--text); line-height: 1.4; }
.blog-link-arrow { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; }

/* アクションボタン */
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.btn-retry, .btn-share {
  border: none;
  border-radius: 10px;
  padding: 14px 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-retry { background: var(--card2); border: 1px solid var(--border); color: var(--text); }
.btn-retry:hover { background: var(--border); }
.btn-share {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}
.btn-share:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,99,235,0.5); }

/* ========================================
   レスポンシブ
   ======================================== */
@media (max-width: 380px) {
  .main-title { font-size: 1.7rem; }
  .answer-buttons { gap: 8px; }
  .btn-yes, .btn-no { padding: 14px 6px; }
  .result-actions { grid-template-columns: 1fr; }
}
