/* ===== 테스트 공통 스타일 ===== */
@font-face {
  font-family: 'NEXON Lv2 Gothic';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_20-04@2.1/NEXON Lv2 Gothic.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #f7f7fb;
  --card: #fff;
  --ink: #222;
  --muted: #666;
  --line: #e8e8ef;
  --brand: #6b0000;
  --brand-ink: #fff;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(28, 25, 55, .08);
  --accent: #7c3aed;
  --accent2: #ec4899;
}

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

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  font-family: 'NEXON Lv2 Gothic', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── 헤더 ── */
.site-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}

.site-header .logo img {
  height: auto;
  width: 180px;
  display: block;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.site-header .nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: .15s;
}

.site-header .nav-btn:hover,
.site-header .nav-btn.active {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

/* ── 컨테이너 ── */
.test-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ── 히어로 ── */
.test-hero {
  text-align: center;
  margin-bottom: 28px;
}

.test-hero .emoji {
  font-size: 56px;
  margin-bottom: 10px;
}

.test-hero h1 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 6px;
}

.test-hero p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* ── 카드 ── */
.test-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

/* ── 진행바 ── */
.progress-bar {
  height: 6px;
  border-radius: 3px;
  background: #e8e8ef;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}

.progress-text {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── 질문 ── */
.question-text {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── 선택지 ── */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
}

.option-btn:hover {
  border-color: var(--accent);
  background: #f8f5ff;
  transform: translateX(4px);
}

.option-btn:active {
  transform: translateX(2px);
}

.option-btn.selected {
  border-color: var(--accent);
  background: #ede9fe;
  font-weight: 600;
}

/* ── 결과 ── */
.result-card {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(30, 27, 75, .3);
}

.result-card .type-emoji {
  font-size: 64px;
  margin-bottom: 12px;
}

.result-card .type-name {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}

.result-card .type-sub {
  font-size: 15px;
  opacity: .8;
  margin-bottom: 16px;
}

.result-card .type-desc {
  font-size: 14px;
  line-height: 1.8;
  opacity: .9;
  text-align: left;
  background: rgba(255, 255, 255, .08);
  padding: 16px;
  border-radius: 12px;
}

/* ── 점수 막대 ── */
.score-bar {
  margin: 8px 0;
}

.score-bar .bar-bg {
  height: 10px;
  background: rgba(255, 255, 255, .15);
  border-radius: 5px;
  overflow: hidden;
}

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

.score-bar .bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}

/* ── 공유 ── */
.share-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-radius: 10px;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}

.share-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.share-btn.kakao {
  background: #FEE500;
  color: #3C1E1E;
}

.share-btn.twitter {
  background: #1DA1F2;
  color: #fff;
}

.share-btn.copy {
  background: #6366f1;
  color: #fff;
}

.share-btn.retry {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}

/* ── 시작 버튼 ── */
.start-btn {
  display: block;
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  cursor: pointer;
  transition: .2s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, .3);
}

/* ── 광고 ── */
.ad-slot {
  background: #fafafa;
  border: 1px dashed var(--line);
  border-radius: 10px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 13px;
  margin: 20px 0;
}

/* ── 푸터 ── */
.site-footer {
  color: var(--muted);
  font-size: 13px;
  padding: 28px 16px;
  text-align: center;
}

/* ── 테스트 목록 그리드 ── */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.test-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: .15s;
}

.test-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.test-item .emoji {
  font-size: 32px;
  margin-bottom: 8px;
}

.test-item h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
}

.test-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* ── 애니메이션 ── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px)
  }

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

.fade-in {
  animation: fadeIn .4s ease forwards;
}

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

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

.slide-in {
  animation: slideIn .3s ease forwards;
}

/* ── 반응형 ── */
@media (max-width: 600px) {
  .test-hero .emoji {
    font-size: 44px;
  }

  .test-hero h1 {
    font-size: 22px;
  }

  .test-card {
    padding: 20px;
  }

  .question-text {
    font-size: 17px;
  }

  .result-card {
    padding: 24px;
  }

  .result-card .type-name {
    font-size: 24px;
  }

  .tests-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header .inner {
    padding: 8px 10px;
  }

  .site-header .logo img {
    width: 140px;
  }
}