/* =============================================================================
 * style.css — 다크 판타지 + 네온 글로우 / 모바일 퍼스트(375px) + 데스크톱 대응
 * 계열 컬러 값: 설계 §7
 * ========================================================================== */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Maru Gothic ProN", "微軟正黑體", "Lucida Grande", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

/* --- 배경: 별입자 + 안개 ------------------------------------------------ */
.bg-stars, .bg-fog { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bg-stars {
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,255,255,0.7), transparent),
    radial-gradient(1.5px 1.5px at 70% 60%, rgba(255,255,255,0.55), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.45), transparent),
    radial-gradient(1px 1px at 10% 65%, rgba(255,255,255,0.5), transparent);
  background-size: 100% 100%;
  animation: starDrift 60s linear infinite;
  opacity: 0.7;
}
.bg-fog {
  background:
    radial-gradient(60% 45% at 25% 20%, rgba(var(--accent-rgb), 0.16), transparent 70%),
    radial-gradient(55% 45% at 80% 75%, rgba(255, 60, 20, 0.12), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(255, 180, 90, 0.10), transparent 70%);
  animation: fogShift 24s ease-in-out infinite alternate;
}
@keyframes starDrift { from { transform: translateY(0); } to { transform: translateY(-40px); } }
@keyframes fogShift { from { transform: translate(-2%, 0) scale(1); } to { transform: translate(2%, -2%) scale(1.08); } }

/* --- 스크린 레이아웃 ---------------------------------------------------- */
#app { position: relative; z-index: 1; }
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: block; }
#screen-quiz.active { display: flex; flex-direction: column; }

/* --- 버튼 --------------------------------------------------------------- */
.btn {
  display: inline-block; border: 0; border-radius: 999px;
  padding: 14px 26px; font-size: 16px; font-weight: 700;
  color: var(--ink); text-decoration: none; text-align: center;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff 10%));
  color: #fff;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent), 0 8px 24px rgba(0,0,0,0.4);
}
.btn-primary:hover { box-shadow: 0 0 40px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-ghost { background: rgba(255,255,255,0.06); border: 1px solid var(--line); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); }
.btn-link { background: transparent; color: var(--ink-dim); font-weight: 600; padding: 10px; }
.btn-link:hover { color: var(--ink); }
.btn-lg { padding: 18px 40px; font-size: 18px; }

/* --- 인트로 ------------------------------------------------------------- */
#screen-intro { display: none; }
#screen-intro.active { display: flex; align-items: center; justify-content: center; padding: 32px 22px; }
.intro-inner { max-width: var(--maxw); text-align: center; animation: fadeUp 0.8s var(--ease) both; }
.intro-logo-link {
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px;
  border-radius: 12px; transition: transform 0.2s var(--ease), filter 0.2s var(--ease);
}
.intro-logo-link:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.12); }
.intro-logo-link:active { transform: translateY(0) scale(0.98); }
.intro-logo { display: block; width: clamp(72px, 20vw, 96px); height: auto; filter: drop-shadow(0 0 14px rgba(var(--accent-rgb), 0.38)); }
.intro-title {
  font-size: clamp(34px, 11vw, 60px); font-weight: 900; line-height: 1.5; letter-spacing: 1px;
  /* background: linear-gradient(180deg, #fff, var(--accent-hi) 68%, var(--accent)); */
  -webkit-background-clip: text; background-clip: text; 
  color: #fff;
  text-shadow: 0 0 40px rgba(var(--accent-rgb), 0.35);
}
.intro-sub { margin-top: 16px; color: var(--gold); font-size: 16px; letter-spacing: 1px; font-weight: 600; }
.intro-copy { margin: 26px auto 34px; color: var(--ink-dim); font-size: 16px; max-width: 30em; letter-spacing: 0;}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- 퀴즈 헤더/진행 ----------------------------------------------------- */
.quiz-head { padding: 20px 20px 6px; display: flex; align-items: center; gap: 14px; max-width: var(--maxw); margin: 0 auto; width: 100%; }
.prog-dots { display: flex; gap: 6px; flex: 1; }
.prog-dot { flex: 1; height: 4px; border-radius: 999px; background: rgba(255,255,255,0.12); transition: background 0.3s, box-shadow 0.3s; }
.prog-dot.done { background: var(--accent); }
.prog-dot.current { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.prog-label { color: var(--ink-dim); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* --- 질문 카드 ---------------------------------------------------------- */
.question-host { flex: 1; display: flex; align-items: center; justify-content: center; padding: 12px 20px 40px; }
.q-card { width: 100%; max-width: var(--maxw); }
.q-enter { opacity: 0; transform: translateY(24px); }
.q-card { transition: opacity 0.5s var(--ease), transform 0.5s var(--ease); opacity: 1; transform: translateY(0); }
.q-copy { font-size: clamp(20px, 5.6vw, 27px); font-weight: 800; text-align: center; line-height: 1.4; letter-spacing: 1px; }
.q-sub { text-align: center; color: var(--ink-dim); font-size: 15px; margin-top: 10px; }

/* --- 선택지 공통 -------------------------------------------------------- */
.q-choices { display: grid; gap: 12px; margin-top: 28px; }
.type-binary { grid-template-columns: 1fr; }
.type-choice5 { grid-template-columns: 1fr; }
.type-image4 { grid-template-columns: 1fr 1fr; }

.choice {
  position: relative; border: 1px solid var(--line); background: rgba(255,255,255,0.04);
  color: var(--ink); border-radius: var(--radius); padding: 18px 20px; font-size: 16px;
  font-weight: 600; text-align: left; line-height: 1.4;
  transition: transform 0.15s var(--ease), border-color 0.2s, background 0.2s, box-shadow 0.25s, opacity 0.3s;
}
.choice:hover { border-color: var(--accent); background: rgba(var(--accent-rgb),0.10); transform: translateY(-2px); }
.choice.chosen { border-color: var(--accent); background: rgba(var(--accent-rgb),0.18); box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent); }
.choice.dim { opacity: 0.35; }

/* 이미지 4택 */
.choice-img { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 16px 12px; }
.choice-art { width: 100%; max-width: 130px; aspect-ratio: 3 / 4; color: var(--ink-dim); display: grid; place-items: center; }
.choice-art svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px currentColor); }
.choice-art.fam-warrior { color: var(--warrior); }
.choice-art.fam-archer  { color: var(--archer); }
.choice-art.fam-mage    { color: var(--mage); }
.choice-art.fam-healer  { color: var(--healer); }
.choice-art.fam-bard    { color: var(--bard); }
.choice-label { font-size: 15px; letter-spacing: 1px;}

/* 최종(카운트다운) 선택 */
.choice-final { text-align: center; font-size: 19px; font-weight: 800; padding: 24px; }

/* 카운트다운 링 */
.countdown-ring {
  width: 120px; height: 120px; margin: 26px auto 8px; border-radius: 50%;
  display: grid; place-items: center; border: 3px solid var(--accent);
  box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 55%, transparent), inset 0 0 20px color-mix(in srgb, var(--accent) 30%, transparent);
}
.countdown-num { font-size: 54px; font-weight: 900; color: var(--accent); font-variant-numeric: tabular-nums; }
.countdown-ring.pulse { animation: cdPulse 0.9s var(--ease); }
.countdown-ring.expired { border-color: var(--gold); box-shadow: 0 0 30px rgba(255,216,138,0.5); }
.countdown-ring.expired .countdown-num { color: var(--gold); font-size: 40px; }
@keyframes cdPulse { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* --- 마이크로 피드백 오버레이 ------------------------------------------ */
.micro-overlay {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: 30px; text-align: center; font-size: clamp(18px, 5vw, 24px); font-weight: 700;
  color: var(--ink); background: rgba(6, 6, 14, 0.72); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity 0.26s var(--ease), visibility 0.26s;
  letter-spacing: 1px;
}
.micro-overlay.show { opacity: 1; visibility: visible; }

/* =============================================================================
 * 미니게임
 * ========================================================================== */
.mg-host { margin-top: 26px; }
.mg-arena {
  position: relative; width: 100%; height: 340px; border-radius: var(--radius);
  border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb),0.10), rgba(0,0,0,0.25));
  overflow: hidden; touch-action: none;
}
.mg-timer { height: 6px; border-radius: 999px; background: rgba(255,255,255,0.10); overflow: hidden; margin-bottom: 12px; }
.mg-timer-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transform-origin: left; transform: scaleX(1); }

/* 구슬 */
.marble { position: absolute; top: 0; left: 0; border-radius: 50%; will-change: transform; cursor: pointer; }
.marble-gold   { background: radial-gradient(circle at 35% 30%, #fff6d8, #ffbf3f 55%, #a06b00); box-shadow: 0 0 22px rgba(255,191,63,0.75); }
.marble-silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c8cfe0 55%, #7d8598); box-shadow: 0 0 18px rgba(200,207,224,0.6); }
.marble-bronze { background: radial-gradient(circle at 35% 30%, #ffd9ad, #c9762f 55%, #7a3d10); box-shadow: 0 0 16px rgba(201,118,47,0.55); }
.marble.caught { animation: marbleCatch 0.32s var(--ease) forwards; }
@keyframes marbleCatch { to { transform: scale(1.9); opacity: 0; } }

/* 다른 하나 그리드 */
.mg-grid { display: grid; gap: 8px; }
.glyph { aspect-ratio: 1; border: 1px solid var(--line); background: rgba(255,255,255,0.03); border-radius: 10px; color: var(--accent); display: grid; place-items: center; padding: 8px; transition: background 0.15s, transform 0.15s; }
.glyph:hover { background: rgba(var(--accent-rgb),0.10); }
.glyph svg { width: 78%; height: 78%; }
.glyph-wrong { animation: shakeX 0.3s; }
.glyph-found { background: rgba(77,255,136,0.22); box-shadow: 0 0 20px rgba(77,255,136,0.6); }
.glyph-reveal { background: rgba(255,216,138,0.22); box-shadow: 0 0 20px rgba(255,216,138,0.6); animation: pulseGlow 0.9s ease infinite alternate; }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pulseGlow { to { box-shadow: 0 0 34px rgba(255,216,138,0.9); } }

/* 잔광 */
.mg-flash { height: 360px; cursor: crosshair; }
.mg-flash-count { text-align: center; margin-top: 10px; color: var(--ink-dim); font-size: 15px; font-variant-numeric: tabular-nums; }
.flash-dot {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff, var(--accent) 60%, transparent);
  box-shadow: 0 0 30px var(--accent), 0 0 60px color-mix(in srgb, var(--accent) 60%, transparent);
  animation: dotPop 0.18s var(--ease); cursor: pointer;
}
@keyframes dotPop { from { transform: scale(0.3); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

/* 차지 */
.mg-charge { display: flex; flex-direction: column; align-items: center; gap: 26px; padding-top: 10px; }
.charge-meter {
  position: relative; width: 120px; height: 240px; border-radius: 60px;
  border: 2px solid var(--line); background: rgba(255,255,255,0.04); overflow: hidden;
}
.charge-fill { position: absolute; left: 0; bottom: 0; width: 100%; height: 0%;
  background: linear-gradient(0deg, var(--accent), var(--gold)); transition: none; }
.charge-pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.6); font-variant-numeric: tabular-nums; }
.charge-over .charge-fill { background: linear-gradient(0deg, #ff6b6b, #ffd24d); }
.charge-danger { animation: chargeShake 0.12s linear infinite; }
.charge-shatter { animation: chargeBreak 0.4s var(--ease) forwards; }
@keyframes chargeShake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-2px,1px); } 75% { transform: translate(2px,-1px); } }
@keyframes chargeBreak { 0% { transform: scale(1); } 40% { transform: scale(1.08); filter: brightness(1.6); } 100% { transform: scale(1); filter: brightness(1); opacity: 0.85; } }
.charge-btn { background: rgba(255,255,255,0.06); border: 1px solid var(--line); color: var(--ink); border-radius: 999px; padding: 16px 34px; font-size: 17px; font-weight: 800; user-select: none; touch-action: none; }
.charge-btn.pressing { background: rgba(var(--accent-rgb),0.24); box-shadow: 0 0 30px color-mix(in srgb, var(--accent) 60%, transparent); }
.charge-btn:disabled { opacity: 0.5; }

/* =============================================================================
 * 결과 — Stage 1 분석
 * ========================================================================== */
#screen-result.active { display: block; }
.stage { position: relative; }
.fade-out { animation: fadeOut 0.5s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-10px); } }

.stage-analysis, .stage-reading, .stage-teaser {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: #05060c; padding: 30px;
}
.scanlines { position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, transparent 1px 3px);
  animation: scan 6s linear infinite; }
@keyframes scan { from { background-position-y: 0; } to { background-position-y: 60px; } }
.analysis-inner { width: 100%; max-width: 480px; font-family: "Hiragino Maru Gothic ProN", "微軟正黑體", "Lucida Grande", Helvetica, Arial, sans-serif; }
.analysis-title { color: var(--accent); letter-spacing: 1px; font-size: 15px; margin-bottom: 22px; text-align: center; text-shadow: 0 0 12px var(--accent); }
.analysis-rows { display: flex; flex-direction: column; gap: 16px; }
.an-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; opacity: 0.4; transition: opacity 0.3s; }
.an-row.shown { opacity: 1; }
.an-label { color: var(--ink-dim); font-size: 15px; min-height: 1.2em; }
.an-value { color: var(--ink); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.an-tag { grid-column: 2; color: var(--gold); font-size: 15px; }
.an-gauge { grid-column: 1 / -1; display: flex; gap: 3px; }
.an-gauge i { flex: 1; height: 10px; border-radius: 2px; background: rgba(255,255,255,0.10); }
.an-gauge i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* Stage 2 리딩 */
.reading-inner { width: 100%; max-width: 540px; }
.reading-line { font-size: clamp(17px, 4.6vw, 22px); font-weight: 600; line-height: 1.6; margin-bottom: 18px; min-height: 1.4em; letter-spacing: 1px; }
.reading-closer { color: var(--ink-dim); font-size: 15px; font-weight: 500; font-style: italic; margin-top: 6px; }

/* Stage 3 티저 + 심장박동 */
.stage-teaser { flex-direction: column; gap: 30px; }
.teaser-text { font-size: clamp(24px, 7vw, 40px); font-weight: 900; letter-spacing: 1px; animation: fadeUp 0.6s var(--ease) both; }
.heartbeat { width: 60px; height: 60px; border-radius: 50%; background: radial-gradient(circle at center, rgba(255,255,255,0.92), rgba(255,255,255,0.24) 14%, rgba(255,255,255,0.08) 28%, transparent 48%), radial-gradient(circle at center, var(--fam) 0%, rgba(255,255,255,0) 66%); box-shadow: 0 0 12px 4px color-mix(in srgb, var(--fam) 55%, transparent), 0 0 28px 14px color-mix(in srgb, var(--fam) 18%, transparent), inset 0 0 8px rgba(255,255,255,0.18); animation: beat 1.8s var(--ease) forwards; }
@keyframes beat {
  0% { transform: scale(1); opacity: 0.9; }
  15% { transform: scale(1.35); } 20% { transform: scale(1); }
  40% { transform: scale(1.4); } 45% { transform: scale(1); }
  62% { transform: scale(1.5); } 66% { transform: scale(1); }
  80% { transform: scale(1.7); } 84% { transform: scale(1); }
  100% { transform: scale(2.4); opacity: 1; }
}

/* 계열 컬러 플래시 + 파티클 */
.family-flash { position: fixed; inset: 0; z-index: 25; pointer-events: none; animation: flashIn 0.5s var(--ease); }
.family-flash.fade-out { animation: fadeOut 0.7s var(--ease) forwards; }
@keyframes flashIn { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: scale(1); } }
.particle-layer { position: fixed; width: 0; height: 0; z-index: 26; pointer-events: none; }
.particle { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.18) 30%, transparent 65%); filter: blur(var(--blur, 1.4px)); mix-blend-mode: screen; pointer-events: none; animation: burst var(--d, 1s) var(--delay, 0s) ease-out forwards; opacity: 0.95; }
.particle::after { content: ""; position: absolute; left: 50%; top: 50%; width: var(--tail, 28px); height: 4px; transform-origin: left center; transform: translateX(8px) translateY(-50%) rotate(var(--r, 0deg)); background: linear-gradient(90deg, rgba(255,255,255,0.95), rgba(255,255,255,0.14) 60%, transparent); opacity: 0.85; filter: blur(0.95px); pointer-events: none; }
.particle.sparkle { width: 4px; height: 4px; background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,255,0.55) 40%, transparent 90%); filter: blur(0.8px); opacity: 0.95; box-shadow: 0 0 8px rgba(255,255,255,0.5); }
.particle.sparkle::after { display: none; }
.particle.core { width: 12px; height: 12px; box-shadow: 0 0 18px rgba(255,255,255,0.35), inset 0 0 10px rgba(255,255,255,0.35); }
@keyframes burst {
  0% { transform: translate(0,0) scale(0.35) rotate(var(--r, 0deg)); opacity: 1; }
  35% { transform: translate(calc(var(--tx) * 0.8), calc(var(--ty) * 0.8)) scale(1.05) rotate(var(--r, 0deg)); opacity: 0.98; }
  65% { transform: translate(calc(var(--tx) * 1.05), calc(var(--ty) * 1.05)) scale(0.75) rotate(var(--r, 0deg)); opacity: 0.7; }
  100% { transform: translate(calc(var(--tx) * 1.25), calc(var(--ty) * 1.25)) scale(0.22) rotate(var(--r, 0deg)); opacity: 0; }
}

/* =============================================================================
 * 결과 — Stage 4 상세
 * ========================================================================== */
.result-detail { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 80px; animation: fadeUp 0.6s var(--ease) both; }

/* 히어로 카드 */
.hero-card {
  position: relative; border-radius: 24px; padding: 30px 24px 26px; text-align: center;
  background: linear-gradient(160deg, color-mix(in srgb, var(--fam) 22%, #10101c), #0c0c16);
  border: 1px solid color-mix(in srgb, var(--fam) 40%, transparent);
  box-shadow: 0 0 50px color-mix(in srgb, var(--fam) 30%, transparent), 0 20px 50px rgba(0,0,0,0.5);
  overflow: hidden; transform-style: preserve-3d; transition: transform 0.15s ease;
}
.hero-card.reveal-in { animation: heroIn 0.7s var(--ease) both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(40px) scale(0.94); } to { opacity: 1; transform: translateY(0) scale(1); } }
.hero-holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen; opacity: 0.5;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.18) 48%, transparent 66%);
  background-size: 250% 250%; animation: holo 4s linear infinite; }
@keyframes holo { from { background-position: 0% 0%; } to { background-position: 200% 200%; } }
.hero-img {
  position: relative; width: 100%; height: clamp(190px, 48vw, 240px); margin: 0 auto 16px;
  display: grid; place-items: center; overflow: visible; isolation: isolate; z-index: 1;
}
.hero-img::before {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: calc(50% + var(--photo-x, 0%)); top: 52%;
  width: min(320px, 78vw); height: min(250px, 62vw);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    color-mix(in srgb, var(--fam) 46%, transparent) 0%,
    color-mix(in srgb, var(--fam) 18%, transparent) 38%,
    transparent 72%);
  filter: blur(10px); opacity: 0.9;
}
.hero-img::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none;
  left: calc(50% + var(--photo-x, 0%)); bottom: -4px;
  width: min(220px, 58vw); height: 24px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center,
    color-mix(in srgb, var(--fam) 42%, transparent), transparent 72%);
  filter: blur(7px); opacity: 0.55;
}
.hero-img .emblem-svg { position: relative; z-index: 1; width: min(150px, 60%); height: min(150px, 60%); filter: drop-shadow(0 0 16px var(--fam)); }
.hero-img .class-photo {
  position: absolute; z-index: 1; left: 50%; bottom: 0; width: auto; height: 100%; max-width: none;
  transform: translate(calc(-50% + var(--photo-x, 0%)), var(--photo-y, 0%)) scale(var(--photo-scale, 1));
  transform-origin: center bottom;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--fam) 70%, transparent));
}
.hero-meta { position: relative; z-index: 2; }
.hero-family { position: relative; color: var(--fam); letter-spacing: 1px; font-size: 15px; font-weight: 700; }
.hero-title { position: relative; margin-top: 8px; font-size: 15px; color: var(--ink-dim); font-weight: 600; }
.hero-name { position: relative; font-size: clamp(34px, 10vw, 50px); font-weight: 900; line-height: 1.1; margin-top: 2px;
  text-shadow: 0 0 30px color-mix(in srgb, var(--fam) 60%, transparent); }
.hero-match { position: relative; margin-top: 14px; font-size: 15px; color: var(--ink-dim); font-weight: 600; }
.hero-match span { font-size: 26px; font-weight: 900; color: var(--fam); font-variant-numeric: tabular-nums; }

/* 상세 블록 */
.detail-block { margin-top: 26px; }
.block-title { font-size: 15px; letter-spacing: 1px; color: var(--fam); font-weight: 800; text-transform: uppercase; margin-bottom: 12px; }
.why-who { font-size: 18px; font-weight: 700; line-height: 1.5; }
.why-why { margin-top: 10px; color: var(--ink-dim); font-size: 15px; }
.why-evidence { margin: 16px 0 0; padding: 14px 16px; border-left: 3px solid var(--fam);
  background: rgba(255,255,255,0.04); border-radius: 0 12px 12px 0; font-size: 15px; color: var(--ink); }

.tip-block { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--fam) 12%, transparent); border: 1px solid color-mix(in srgb, var(--fam) 30%, transparent); }
.tip-icon { color: var(--fam); font-size: 20px; }
.tip-text { font-weight: 700; }

/* MBTI 카드 */
.mbti-card { padding: 20px; border-radius: 16px; background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.mbti-guess { font-size: 20px; font-weight: 700; }
.mbti-guess b { color: var(--gold); letter-spacing: 1px; }
.mbti-conf { color: var(--ink-dim); font-size: 15px; font-weight: 600; }
.mbti-gauges { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.mbti-axis { display: grid; grid-template-columns: 24px 1fr 24px; align-items: center; gap: 10px; }
.mbti-axis span { font-weight: 800; color: var(--ink-dim); text-align: center; }
.mbti-axis .active { color: var(--gold); }
.mx-bar { position: relative; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.10); overflow: hidden; }
.mx-bar i { position: absolute; top: 0; height: 100%; background: var(--gold); box-shadow: 0 0 10px var(--gold); border-radius: 999px; }
.mbti-disc { margin-top: 16px; color: var(--ink-dim); font-size: 15px; font-style: italic; }

/* 러너업 */
.runner-row { display: grid; gap: 12px; }
.runner-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.runner-emblem { width: 52px; height: 52px; flex: none; }
.runner-emblem .emblem-svg { width: 100%; height: 100%; }
.runner-title { font-size: 15px; color: var(--ink-dim); }
.runner-name { font-size: 18px; font-weight: 800; }
.runner-fam { color: var(--ink-dim); font-size: 15px; font-weight: 600; }
.runner-match { font-size: 15px; font-weight: 700; margin-top: 2px; }
.runner-card.fam-warrior { border-color: color-mix(in srgb, var(--warrior) 45%, transparent); }
.runner-card.fam-archer  { border-color: color-mix(in srgb, var(--archer) 45%, transparent); }
.runner-card.fam-mage    { border-color: color-mix(in srgb, var(--mage) 45%, transparent); }
.runner-card.fam-healer  { border-color: color-mix(in srgb, var(--healer) 45%, transparent); }
.runner-card.fam-bard    { border-color: color-mix(in srgb, var(--bard) 45%, transparent); }
.runner-card.fam-rogue   { border-color: color-mix(in srgb, var(--rogue) 45%, transparent); }
.runner-card.fam-warrior .runner-match { color: var(--warrior); }
.runner-card.fam-archer  .runner-match { color: var(--archer); }
.runner-card.fam-mage    .runner-match { color: var(--mage); }
.runner-card.fam-healer  .runner-match { color: var(--healer); }
.runner-card.fam-bard    .runner-match { color: var(--bard); }
.runner-card.fam-rogue   .runner-match { color: var(--rogue); }

/* 액션 */
.actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 34px; }
.actions .btn { width: 100%; max-width: 320px; }
.actions .btn[aria-busy="true"] { opacity: 0.65; cursor: wait; }
.share-status { color: var(--gold); font-size: 15px; text-align: center; min-height: 1.2em; margin-top: 4px; }

/* 공유 진입 헤더 (누군가 당신에게 감정 결과를 보냈어요) */
.shared-banner {
  text-align: center; margin: 0 auto 22px; padding: 12px 18px; max-width: 460px;
  font-size: 15px; font-weight: 700; letter-spacing: 1px; color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--fam) 40%, transparent);
  border-radius: 999px; background: color-mix(in srgb, var(--fam) 14%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--fam) 25%, transparent);
  animation: fadeUp 0.6s var(--ease) both;
}

/* 토스트 (링크 복사 알림) */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px); z-index: 60;
  padding: 12px 22px; border-radius: 999px; font-size: 15px; font-weight: 700;
  color: #1a0f07; background: linear-gradient(135deg, var(--accent), var(--accent-hi));
  box-shadow: 0 8px 28px rgba(0,0,0,0.5), 0 0 28px rgba(var(--accent-rgb), 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 승자 계열 강조 클래스 (JS 가 --fam 을 세팅, 여기선 accent 도 맞춰줌) */
.result-detail.fam-warrior { --accent: var(--warrior); }
.result-detail.fam-archer  { --accent: var(--archer); }
.result-detail.fam-mage    { --accent: var(--mage); }
.result-detail.fam-healer  { --accent: var(--healer); }
.result-detail.fam-bard    { --accent: var(--bard); }
.result-detail.fam-rogue   { --accent: var(--rogue); }

/* =============================================================================
 * 데스크톱 대응
 * ========================================================================== */
@media (min-width: 720px) {
  .type-image4 { grid-template-columns: repeat(4, 1fr); }
  .type-binary { grid-template-columns: 1fr 1fr; }
  .mg-arena { height: 400px; }
  .runner-row { grid-template-columns: 1fr 1fr; }
  .choice-art { max-width: 150px; }
}


/* =============================================================================
 * 접근성: prefers-reduced-motion (연출 간소화)
 * ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .bg-stars, .bg-fog, .scanlines, .hero-holo { animation: none !important; }
  .heartbeat { animation: none !important; opacity: 1; }
  .particle { display: none; }
  .q-card, .intro-inner, .result-detail, .hero-card.reveal-in, .teaser-text { animation: none !important; }
  .choice, .btn { transition: none; }
  * { scroll-behavior: auto !important; }
}
