/* =============================================
   摂南大学 適正診断 — オレンジテーマ
   ============================================= */

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

:root {
  --orange:       #F07020;
  --orange-dark:  #D45A0A;
  --orange-light: #FF9044;
  --orange-pale:  #FFF0E6;
  --orange-pale2: #FFE4CC;
  --yellow:       #FFD060;
  --white:        #FFFFFF;
  --gray-light:   #F7F7F7;
  --gray:         #E8E8E8;
  --gray-text:    #888;
  --text:         #222;
  --text-sub:     #666;
  --radius:       18px;
  --radius-sm:    10px;
  --shadow:       0 4px 24px rgba(240,112,32,.18);
  --shadow-sm:    0 2px 10px rgba(0,0,0,.08);

  /* 学部カラー */
  --law:   #7B3FE4;
  --intl:  #0095D9;
  --econ:  #E83048;
  --mgmt:  #F07020;
  --soc:   #2BAE76;
  --sci:   #1565C0;
}

html { scroll-behavior: smooth; }

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

/* ─── ヘッダー ─── */
.site-header {
  background: linear-gradient(135deg, var(--orange-dark) 0%, var(--orange) 60%, var(--orange-light) 100%);
  color: #fff;
  padding: 12px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 16px rgba(212,90,10,.35);
}
.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.logo-area { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.logo-univ {
  background: rgba(255,255,255,.25);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: .06em;
  white-space: nowrap;
}
.logo-title { font-size: .95rem; font-weight: 700; white-space: nowrap; }
.header-campus { font-size: .72rem; opacity: .85; white-space: nowrap; }
.header-campus i { margin-right: 3px; }

/* ─── コンテナ ─── */
.container { max-width: 680px; margin: 0 auto; padding: 24px 16px 48px; }

/* ─── 画面切替 ─── */
.screen { display: none; }
.screen.active { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   ① スタート画面
   ============================================= */
.start-hero { text-align: center; padding: 28px 0 20px; }

.hero-badge {
  display: inline-block;
  background: var(--yellow);
  color: var(--orange-dark);
  font-size: .82rem;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 18px;
  letter-spacing: .04em;
}

.start-title {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1.35;
  margin-bottom: 14px;
  color: var(--text);
}
.accent-text {
  color: var(--orange);
  position: relative;
}
.accent-text::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 4px;
  background: var(--yellow);
  border-radius: 2px;
}

.start-desc {
  font-size: .92rem;
  color: var(--text-sub);
  margin-bottom: 24px;
  line-height: 1.8;
}

/* 学部チップ */
.dept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 700;
  color: #fff;
}
.chip.law  { background: var(--law); }
.chip.intl { background: var(--intl); }
.chip.econ { background: var(--econ); }
.chip.mgmt { background: var(--mgmt); }
.chip.soc  { background: var(--soc); }
.chip.sci  { background: var(--sci); }

/* メタ情報 */
.start-meta {
  display: flex;
  gap: 18px;
  justify-content: center;
  font-size: .82rem;
  color: var(--text-sub);
  margin-bottom: 26px;
}
.start-meta i { color: var(--orange); margin-right: 4px; }

/* スタートボタン */
.btn-start {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 18px 48px;
  font-size: 1.1rem;
  font-weight: 800;
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(240,112,32,.45);
  transition: transform .2s, box-shadow .2s;
  margin-bottom: 24px;
  letter-spacing: .04em;
}
.btn-start:hover { transform: translateY(-3px); box-shadow: 0 10px 32px rgba(240,112,32,.55); }
.btn-start:active { transform: translateY(0); }

/* 相談ティーザー */
.booth-teaser {
  background: var(--orange-pale);
  border: 2px dashed var(--orange-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: .82rem;
  color: var(--orange-dark);
  line-height: 1.7;
}
.booth-teaser i { margin-right: 6px; color: var(--orange); }

/* =============================================
   ② クイズ画面
   ============================================= */

/* プログレス */
.progress-area { margin-bottom: 20px; }
.progress-top {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: 7px;
}
.progress-label { color: var(--orange-dark); }
.progress-pct   { color: var(--orange); }
.progress-track {
  height: 10px;
  background: var(--gray);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange-light), var(--orange));
  border-radius: 5px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  width: 0%;
}
.progress-dots {
  display: flex;
  gap: 5px;
  justify-content: center;
}
.p-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray);
  transition: background .3s;
}
.p-dot.done { background: var(--orange); }
.p-dot.cur  { background: var(--orange-light); transform: scale(1.3); }

/* 質問カード */
.q-card {
  background: var(--white);
  border-radius: 24px;
  padding: 30px 24px 28px;
  box-shadow: var(--shadow);
  border: 2px solid var(--orange-pale2);
  margin-bottom: 18px;
  animation: slideCard .35s ease;
}
@keyframes slideCard {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
.q-tag {
  display: inline-block;
  background: var(--orange-pale);
  color: var(--orange-dark);
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  letter-spacing: .06em;
}
.q-emoji {
  font-size: 2.6rem;
  text-align: center;
  margin-bottom: 10px;
  line-height: 1;
}
.q-text {
  font-size: 1.08rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.55;
  margin-bottom: 28px;
  color: var(--text);
}

/* 5段階スケール */
.scale-wrap { user-select: none; }

.scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.scale-labels span {
  font-size: .65rem;
  color: var(--gray-text);
  text-align: center;
  line-height: 1.35;
  width: 18%;
}

.scale-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}
.scale-btn {
  flex: 1;
  aspect-ratio: 1;
  max-width: 64px;
  border: 3px solid var(--gray);
  border-radius: 50%;
  background: var(--white);
  font-family: 'Noto Sans JP', sans-serif;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.scale-num {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gray-text);
  transition: color .18s;
}
.scale-btn:hover {
  border-color: var(--orange-light);
  background: var(--orange-pale);
  transform: scale(1.08);
}
.scale-btn:hover .scale-num { color: var(--orange); }

/* 選択済みスタイル（1〜5で色が段階的に濃く） */
.scale-btn.sel-1 { border-color: #ccc; background: #f0f0f0; }
.scale-btn.sel-1 .scale-num { color: #999; }

.scale-btn.sel-2 { border-color: #FFBF80; background: #FFF0E0; }
.scale-btn.sel-2 .scale-num { color: #CC7020; }

.scale-btn.sel-3 { border-color: var(--orange-light); background: var(--orange-pale); }
.scale-btn.sel-3 .scale-num { color: var(--orange); }

.scale-btn.sel-4 { border-color: var(--orange); background: #FFE0C0; transform: scale(1.08); }
.scale-btn.sel-4 .scale-num { color: var(--orange-dark); }

.scale-btn.sel-5 {
  border-color: var(--orange-dark);
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  transform: scale(1.14);
  box-shadow: 0 4px 16px rgba(240,112,32,.4);
}
.scale-btn.sel-5 .scale-num { color: #fff; }

/* 戻るボタン */
.quiz-nav { display: flex; }
.btn-back {
  background: none;
  border: 2px solid var(--gray);
  border-radius: 50px;
  padding: 9px 20px;
  font-size: .84rem;
  font-weight: 600;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-sub);
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-back:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-pale); }
.btn-back:disabled { opacity: .35; cursor: not-allowed; }

/* =============================================
   ③ 結果画面
   ============================================= */
.result-hero {
  text-align: center;
  padding: 24px 0 16px;
  position: relative;
}
.result-fireworks {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  overflow: hidden;
  pointer-events: none;
}
.result-label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: .1em;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.result-title {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.45;
  color: var(--text);
}

/* 結果カード */
.result-card {
  background: var(--white);
  border-radius: 22px;
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 2px solid var(--gray);
  animation: cardPop .5s ease both;
  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: .05s; }
.result-card:nth-child(2) { animation-delay: .18s; }
.result-card:nth-child(3) { animation-delay: .31s; }

@keyframes cardPop {
  from { opacity: 0; transform: translateY(20px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.result-card.rank-1 { border-color: #F4C430; }
.result-card.rank-1::before { background: linear-gradient(90deg,#F4C430,#E8A000); }
.result-card.rank-2 { border-color: #C0C0C0; }
.result-card.rank-2::before { background: linear-gradient(90deg,#C0C0C0,#999); }
.result-card.rank-3 { border-color: #CD7F32; }
.result-card.rank-3::before { background: linear-gradient(90deg,#CD7F32,#A05020); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 50px;
  margin-bottom: 12px;
}
.rank-1 .rank-badge { background: #FFF8E0; color: #A07800; }
.rank-2 .rank-badge { background: #F5F5F5; color: #666; }
.rank-3 .rank-badge { background: #FFF3E0; color: #8B4513; }

.result-card-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}
.rc-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  flex-shrink: 0;
}
.rc-info { flex: 1; }
.rc-faculty { font-size: .75rem; font-weight: 600; opacity: .65; margin-bottom: 3px; }
.rc-dept    { font-size: 1.12rem; font-weight: 900; line-height: 1.3; }

/* マッチ度バー */
.match-wrap { margin-bottom: 14px; }
.match-head {
  display: flex;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 5px;
}
.match-label { color: var(--text-sub); }
.match-pct   { color: var(--orange); font-size: .9rem; }
.match-track {
  height: 10px;
  background: var(--gray);
  border-radius: 5px;
  overflow: hidden;
}
.match-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1.1s cubic-bezier(.4,0,.2,1);
  width: 0%;
}

/* 説明・タグ・リンク */
.rc-desc {
  background: var(--orange-pale);
  border-left: 4px solid var(--orange-light);
  border-radius: 0 8px 8px 0;
  padding: 11px 13px;
  font-size: .83rem;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--text);
}
.rc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rc-tag {
  background: var(--orange-pale);
  color: var(--orange-dark);
  font-size: .73rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50px;
  border: 1px solid var(--orange-pale2);
}
.btn-dept-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--orange), var(--orange-dark));
  color: #fff;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 700;
  transition: all .2s;
  box-shadow: 0 3px 12px rgba(240,112,32,.35);
}
.btn-dept-link:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(240,112,32,.45); }

/* 全スコア */
.all-score-section { margin: 20px 0; text-align: center; }
.btn-all-score {
  background: none;
  border: 2px solid var(--gray);
  border-radius: 50px;
  padding: 10px 22px;
  font-size: .83rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-sub);
  cursor: pointer;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-all-score:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-pale); }
.all-score-list {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray);
  text-align: left;
}
.as-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f2f2f2; }
.as-row:last-child { border-bottom: none; }
.as-name { width: 140px; font-size: .8rem; font-weight: 700; flex-shrink: 0; }
.as-track { flex: 1; height: 8px; background: var(--gray); border-radius: 4px; overflow: hidden; }
.as-bar   { height: 100%; border-radius: 4px; }
.as-pct   { width: 36px; text-align: right; font-size: .78rem; font-weight: 700; color: var(--text-sub); }

/* 相談ブースバナー */
.booth-banner {
  background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%);
  border-radius: 20px;
  padding: 22px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: #fff;
  margin: 24px 0 20px;
  box-shadow: 0 6px 28px rgba(240,112,32,.4);
  position: relative;
  overflow: hidden;
}
.booth-banner::after {
  content: '🎓';
  position: absolute;
  right: -8px; bottom: -10px;
  font-size: 5rem;
  opacity: .12;
}
.booth-banner-icon {
  width: 44px; height: 44px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.booth-banner-title {
  font-size: .8rem;
  font-weight: 700;
  opacity: .85;
  margin-bottom: 5px;
}
.booth-banner-place {
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.5;
  margin-bottom: 6px;
}
.booth-banner-place span {
  font-size: .88rem;
  font-weight: 700;
  background: rgba(255,255,255,.25);
  padding: 2px 8px;
  border-radius: 4px;
}
.booth-banner-note { font-size: .78rem; opacity: .88; line-height: 1.6; }

/* アクションボタン */
.result-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.btn-retry {
  flex: 1; min-width: 140px;
  background: none;
  border: 2px solid var(--orange);
  border-radius: 50px;
  padding: 13px 20px;
  font-size: .9rem;
  font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--orange);
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 7px;
}
.btn-retry:hover { background: var(--orange); color: #fff; }
.btn-official {
  flex: 1; min-width: 140px;
  background: linear-gradient(135deg, #444, #222);
  color: #fff;
  text-decoration: none;
  border-radius: 50px;
  padding: 13px 20px;
  font-size: .9rem;
  font-weight: 700;
  text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: all .2s;
}
.btn-official:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* ─── フッター ─── */
.site-footer {
  background: var(--orange-dark);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 18px;
  font-size: .76rem;
}
.footer-note { margin-top: 4px; opacity: .7; }

/* ─── 花火パーティクル ─── */
.fw-piece {
  position: absolute;
  border-radius: 50%;
  animation: fwFall 1.8s ease-in both;
}
@keyframes fwFall {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(80px) scale(.3); opacity: 0; }
}

/* ─── レスポンシブ ─── */
@media (max-width: 480px) {
  .start-title { font-size: 1.5rem; }
  .btn-start   { padding: 15px 36px; font-size: 1rem; }
  .scale-labels span { font-size: .58rem; }
  .scale-btn { max-width: 52px; }
  .scale-num { font-size: 1rem; }
  .result-title { font-size: 1.2rem; }
  .result-actions { flex-direction: column; }
  .as-name { width: 110px; font-size: .74rem; }
  .booth-banner { flex-direction: column; gap: 10px; }
}
