/* ==========================================================================
   shared.css — Web Diagnostic Tools Common Stylesheet
   恋愛診断ラボ 共通 CSS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Custom Properties（テーマ変数）
   -------------------------------------------------------------------------- */
:root {
  --primary: #ff6b9d;
  --primary-light: #ff8a80;
  --primary-dark: #e91e63;
  --bg-gradient: linear-gradient(135deg, #ff6b9d 0%, #ff8a80 50%, #ffab91 100%);
  --border-color: #f0e0e8;
  --hover-bg: #fff5f7;
  --accent-text: #ff6b9d;
}

/* --------------------------------------------------------------------------
   2. 共通リセット + ベーススタイル
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: #333;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --------------------------------------------------------------------------
   3. ヘッダー
   -------------------------------------------------------------------------- */
.header {
  text-align: center;
  padding: 30px 0 20px;
}

.header a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 8px 12px;
}

.header h1 {
  font-size: 1.8rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
  margin-top: 8px;
}

.header .target-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 16px;
  background: rgba(255,255,255,0.3);
  border-radius: 20px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. プログレスバー
   -------------------------------------------------------------------------- */
.progress-wrap {
  margin: 16px 0;
}

.progress-text {
  text-align: center;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255,255,255,0.3);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

/* --------------------------------------------------------------------------
   5. 質問カード
   -------------------------------------------------------------------------- */
.question-card {
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.question-number {
  font-size: 0.85rem;
  color: var(--accent-text);
  font-weight: 700;
  margin-bottom: 8px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 24px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.option-btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 14px;
  font-size: 0.95rem;
  font-family: 'Noto Sans JP', sans-serif;
  color: #333;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: left;
  line-height: 1.5;
}

@media (hover: hover) {
  .option-btn:hover {
    border-color: var(--primary);
    background: var(--hover-bg);
    transform: translateX(4px);
  }
}

.option-btn:active {
  transform: scale(0.98);
}

/* .option-btn.selected は quiz-engine.js に一元化 */

/* --------------------------------------------------------------------------
   6. スタート画面
   -------------------------------------------------------------------------- */
.start-screen {
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.start-screen .emoji {
  font-size: 4rem;
  margin-bottom: 16px;
}

.start-screen p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.7;
  margin-bottom: 32px;
}

.start-btn {
  display: inline-block;
  padding: 16px 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  box-shadow: 0 4px 20px rgba(255,107,157,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(255,107,157,0.5);
}

/* --------------------------------------------------------------------------
   7. 結果画面
   -------------------------------------------------------------------------- */
.result-screen {
  display: none;
  text-align: center;
  animation: scaleIn 0.5s ease-out;
}

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

.result-rank {
  font-size: 5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), #c44dff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.result-label {
  font-size: 1.5rem;
  font-weight: 900;
  margin: 8px 0 16px;
  color: var(--primary-dark);
}

.result-desc {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.7;
  margin-bottom: 24px;
  text-align: left;
}

.result-meter {
  margin: 24px 0;
}

.result-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #999;
  margin-bottom: 8px;
}

.result-meter-bar {
  width: 100%;
  height: 12px;
  background: var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.result-meter-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), #c44dff);
  transition: width 1s ease;
}

/* --------------------------------------------------------------------------
   8. CTA ボタン群（優先順位：note > X > LINE > Instagram > 他の診断 > もう一度）
   -------------------------------------------------------------------------- */

/* note リンク — 最重要 CTA */
.note-link {
  display: inline-block;
  padding: 18px 40px;
  background: var(--primary);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 16px;
  box-shadow: 0 4px 20px rgba(255,107,157,0.4);
}

.note-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(255,107,157,0.5);
}

/* X シェアボタン — 黒 */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #000;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  margin-bottom: 16px;
  transition: background 0.2s, transform 0.2s;
}

.share-btn:hover {
  background: #333;
  transform: translateY(-1px);
}

/* LINE シェアボタン — 緑 */
.share-btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: #06c755;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  margin-bottom: 16px;
  transition: background 0.2s, transform 0.2s;
}

.share-btn-line:hover {
  background: #05b04b;
  transform: translateY(-1px);
}

/* Instagram シェアボタン — グラデーション */
.share-btn-instagram {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  margin-bottom: 16px;
  transition: opacity 0.2s, transform 0.2s;
}

.share-btn-instagram:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* 他の診断カードリンク */
.other-diagnostic {
  display: block;
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 24px 20px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}

.other-diagnostic:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}

.other-diagnostic::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

.other-diagnostic .card-emoji {
  font-size: 2rem;
  margin-bottom: 8px;
}

.other-diagnostic .card-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.other-diagnostic .card-desc {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.6;
}

.other-diagnostic .card-arrow {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: #ccc;
  transition: color 0.3s, transform 0.3s;
}

.other-diagnostic:hover .card-arrow {
  color: var(--primary);
  transform: translateY(-50%) translateX(4px);
}

/* もう一度ボタン — 控えめアウトライン */
.retry-btn {
  display: inline-block;
  padding: 12px 28px;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  transition: all 0.2s;
}

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

/* ホームリンク — テキストリンク */
.home-link {
  display: block;
  margin-top: 16px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.85rem;
}

.home-link:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   9-11: 分析中演出・紙吹雪・戻るボタンは quiz-engine.js に一元化
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   12. アニメーション
   -------------------------------------------------------------------------- */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

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

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   13. フッター
   -------------------------------------------------------------------------- */
footer {
  text-align: center;
  padding: 24px 0;
  color: rgba(255,255,255,0.6);
  font-size: 0.75rem;
  line-height: 1.6;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  padding: 8px 12px;
}

footer a:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   14. PC メディアクエリ
   -------------------------------------------------------------------------- */
@media (min-width: 768px) {
  .container { max-width: 600px; }
  .question-card { padding: 48px 40px; }
  .option-btn { font-size: 1rem; }
  h1 { font-size: 2rem; }
}

@media (min-width: 1024px) {
  .container { max-width: 640px; }
  .result-meter { max-width: 480px; margin-left: auto; margin-right: auto; }
}

/* 15. Small viewport（320px 以下） */
@media (max-width: 360px) {
  .start-btn { padding: 14px 32px; font-size: 1rem; }
  .container { padding: 16px; }
}
