/* =============================================
   摂南大学 適正診断サイト - スタイルシート
   ============================================= */

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

:root {
  --primary: #003d7a;
  --primary-light: #1a5fa8;
  --primary-dark: #002a55;
  --accent: #e8a000;
  --accent-light: #ffc533;
  --accent-dark: #c07800;
  --success: #00875a;
  --bg: #f4f7fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-sub: #5a6070;
  --border: #dce3ef;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-lg: 24px;

  /* 学部カラー */
  --law: #8B2FC9;
  --international: #0077B6;
  --economics: #e63946;
  --management: #e07800;
  --social: #2e9e6e;
  --science: #1565c0;
  --pharm: #00897b;
  --nursing: #e91e8c;
  --agri: #558b2f;
}

html {
  scroll-behavior: smooth;
}

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

/* --- ヘッダー --- */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 12px rgba(0,61,122,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-badge {
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.logo-text {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.header-sub {
  font-size: 0.72rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* --- メインコンテナ --- */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* --- 画面切り替え --- */
.screen {
  display: none;
  animation: fadeIn 0.4s ease;
}
.screen.active {
  display: block;
}

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

/* =============================================
   スタート画面
   ============================================= */
.start-hero {
  text-align: center;
  padding: 32px 16px 24px;
}

.start-icon-wrap {
  width: 90px;
  height: 90px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(0,61,122,0.3);
}

.start-icon {
  font-size: 2.5rem;
  color: #fff;
}

.start-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--primary-dark);
  line-height: 1.4;
  margin-bottom: 16px;
}

.start-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  max-width: 400px;
  margin: 0 auto 24px;
  line-height: 1.8;
}

.start-desc strong {
  color: var(--primary);
  font-weight: 700;
}

.start-info-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.info-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--text-sub);
  box-shadow: var(--shadow-sm);
}

.info-card i {
  color: var(--primary);
  font-size: 1.2rem;
}

.info-card strong {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  display: block;
}

.btn-start {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 16px 44px;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(232,160,0,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.04em;
}

.btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(232,160,0,0.5);
}

.btn-start:active {
  transform: translateY(0);
}

/* 学部プレビュー */
.faculty-preview {
  margin-top: 40px;
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-sub);
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.faculty-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.faculty-chip {
  padding: 7px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.faculty-chip.law        { background: var(--law); }
.faculty-chip.international { background: var(--international); }
.faculty-chip.economics  { background: var(--economics); }
.faculty-chip.management { background: var(--management); }
.faculty-chip.social     { background: var(--social); }
.faculty-chip.science    { background: var(--science); }
.faculty-chip.pharm      { background: var(--pharm); }
.faculty-chip.nursing    { background: var(--nursing); }
.faculty-chip.agri       { background: var(--agri); }

/* =============================================
   クイズ画面
   ============================================= */
.progress-wrap {
  margin-bottom: 20px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.progress-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* 質問カード */
.question-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  animation: slideIn 0.35s ease;
}

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

.question-category {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}

.question-icon {
  font-size: 2.4rem;
  text-align: center;
  margin-bottom: 12px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.6;
  text-align: center;
  margin-bottom: 24px;
}

/* 選択肢グリッド */
.choices-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  background: #f8faff;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.choice-btn .choice-emoji {
  font-size: 1.6rem;
  line-height: 1;
}

.choice-btn:hover {
  border-color: var(--primary-light);
  background: #eef4ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,61,122,0.15);
}

.choice-btn:active {
  transform: translateY(0);
}

.choice-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, #eef4ff, #dde8ff);
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0,61,122,0.2);
}

/* ナビゲーション */
.quiz-nav {
  display: flex;
  justify-content: flex-start;
}

.btn-back {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-back:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f5ff;
}

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

/* =============================================
   結果画面
   ============================================= */
.result-header {
  text-align: center;
  padding: 28px 16px 20px;
  position: relative;
}

.result-star {
  font-size: 3rem;
  color: var(--accent);
  animation: starPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: block;
  margin-bottom: 12px;
}

@keyframes starPop {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.result-title {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.result-subtitle {
  font-size: 0.9rem;
  color: var(--text-sub);
}

/* 結果カード */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--border);
  animation: cardAppear 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.25s; }
.result-card:nth-child(3) { animation-delay: 0.4s; }

@keyframes cardAppear {
  to { opacity: 1; transform: translateY(0); }
}

.result-card.rank-1 {
  border-color: #f4c430;
  box-shadow: 0 6px 30px rgba(244,196,48,0.25);
}
.result-card.rank-1::before { background: linear-gradient(90deg, #f4c430, #e8a000); }

.result-card.rank-2 {
  border-color: #c0c0c0;
  box-shadow: 0 4px 20px rgba(160,160,160,0.2);
}
.result-card.rank-2::before { background: linear-gradient(90deg, #c0c0c0, #999); }

.result-card.rank-3 {
  border-color: #cd7f32;
  box-shadow: 0 4px 16px rgba(205,127,50,0.2);
}
.result-card.rank-3::before { background: linear-gradient(90deg, #cd7f32, #a0522d); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  margin-bottom: 14px;
}

.rank-1 .rank-badge { background: #fff8e0; color: #b8860b; }
.rank-2 .rank-badge { background: #f5f5f5; color: #666; }
.rank-3 .rank-badge { background: #fff3e0; color: #8b4513; }

.rank-badge i { font-size: 1rem; }

.result-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.result-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #fff;
  flex-shrink: 0;
}

.result-card-info {
  flex: 1;
}

.result-faculty-name {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 3px;
}

.result-dept-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
}

/* マッチスコアバー */
.score-wrap {
  margin: 4px 0 14px;
}

.score-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.score-text { color: var(--text-sub); }

.score-pct {
  font-weight: 800;
  color: var(--primary);
}

.score-bar {
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
}

.score-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease;
  width: 0%;
}

/* 結果テキスト */
.result-reason {
  background: #f8faff;
  border-left: 4px solid var(--primary-light);
  border-radius: 0 8px 8px 0;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 14px;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.result-tag {
  background: #eef4ff;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid #ccdaf5;
}

.btn-faculty-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s;
  box-shadow: 0 3px 12px rgba(0,61,122,0.3);
}

.btn-faculty-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,61,122,0.4);
}

/* 全学部スコア */
.all-scores-wrap {
  margin: 24px 0;
  text-align: center;
}

.btn-toggle-scores {
  background: transparent;
  border: 2px solid var(--border);
  border-radius: 50px;
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-toggle-scores:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f5ff;
}

.all-scores-list {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.score-row:last-child { border-bottom: none; }

.score-row-name {
  width: 150px;
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.score-row-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.score-row-bar {
  height: 100%;
  border-radius: 4px;
}

.score-row-pct {
  width: 38px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-sub);
}

/* アクションボタン */
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 20px;
}

.btn-retry {
  flex: 1;
  min-width: 160px;
  background: transparent;
  border: 2px solid var(--primary);
  border-radius: 50px;
  padding: 13px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--primary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-official {
  flex: 1;
  min-width: 160px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  padding: 13px 20px;
  font-size: 0.92rem;
  font-weight: 700;
  text-align: center;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(232,160,0,0.35);
}

.btn-official:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(232,160,0,0.5);
}

/* フッター */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.7);
  padding: 20px;
  text-align: center;
  font-size: 0.78rem;
}

.footer-inner p + p {
  margin-top: 4px;
}

.footer-note a {
  color: var(--accent-light);
  text-decoration: none;
}

.footer-note a:hover {
  text-decoration: underline;
}

/* =============================================
   レスポンシブ (スマホ)
   ============================================= */
@media (max-width: 480px) {
  .start-title {
    font-size: 1.3rem;
  }

  .start-info-cards {
    gap: 8px;
  }

  .info-card {
    padding: 10px 14px;
    font-size: 0.78rem;
  }

  .btn-start {
    padding: 14px 36px;
    font-size: 1rem;
  }

  .choices-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .choice-btn {
    flex-direction: row;
    justify-content: flex-start;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.88rem;
  }

  .choice-btn .choice-emoji {
    font-size: 1.4rem;
    flex-shrink: 0;
  }

  .question-text {
    font-size: 0.98rem;
  }

  .result-title {
    font-size: 1.4rem;
  }

  .result-card-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }

  .result-dept-name {
    font-size: 1rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .score-row-name {
    width: 130px;
    font-size: 0.78rem;
  }
}

/* =============================================
   アニメーション・ユーティリティ
   ============================================= */
.pulse {
  animation: pulse 2s infinite;
}

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

/* =============================================
   相談ブース誘導バナー
   ============================================= */
.consult-banner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, #003d7a 0%, #1a5fa8 100%);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  margin: 8px 0 20px;
  box-shadow: 0 6px 24px rgba(0,61,122,0.28);
  animation: cardAppear 0.5s ease 0.5s both;
}

.consult-banner-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.18);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: #fff;
  flex-shrink: 0;
}

.consult-banner-body {
  flex: 1;
  color: #fff;
}

.consult-banner-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-light);
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.consult-banner-text {
  font-size: 0.88rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.92);
  margin-bottom: 12px;
}

.consult-banner-text strong {
  color: #fff;
  font-weight: 800;
  background: rgba(255,197,51,0.22);
  padding: 1px 4px;
  border-radius: 4px;
}

.consult-banner-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.consult-banner-tags span {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 5px;
}

.consult-banner-tags span i {
  color: var(--accent-light);
  font-size: 0.8rem;
}

@media (max-width: 480px) {
  .consult-banner {
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px;
  }

  .consult-banner-icon {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }

  .consult-banner-text {
    font-size: 0.83rem;
  }

  .consult-banner-tags span {
    font-size: 0.72rem;
    padding: 4px 10px;
  }
}

/* コンフェッティ */
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  animation: confettiFall 2s ease-in forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(80px) rotate(720deg); opacity: 0; }
}
