@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700;800;900&display=swap');

:root {
    /* ---- etfCraft 브랜드 토큰 (사이트 기본값과 동일) ---- */
    --bg-navy: #0a0e18;
    --card-navy: #010311;
    --card-navy-soft: #131f36;
    --border-line: rgba(148, 163, 184, 0.14);
    --accent-mint: #2dd4bf;
    --accent-mint-dim: rgba(45, 212, 191, 0.15);
    --text-white: #f4f7fb;
    --text-muted: #8b98ab;

    /* ---- FIRE 테스트 전용 포인트: 골드 ---- */
    --accent-gold: #ffc966;
    --accent-gold-deep: #e6a83a;
    --accent-gold-dim: rgba(255, 201, 102, 0.18);

    /* ---- 화이트 톤(카드 내부) ---- */
    --card-white: #ffffff;
    --card-tint: #f6f8ff;
    --border-line-soft: rgba(79, 70, 229, 0.12);
    --text-dark: #12172a;
    --text-dark-muted: #626c7d;
    --accent-mint-text: #0d9488;

    --shadow-stage: 0 30px 70px rgba(3, 6, 14, 0.45);
    --shadow-soft: 0 10px 26px rgba(15, 23, 42, 0.06);
    --font-base: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 12% 8%, rgba(242, 184, 75, 0.10), transparent 40%),
        radial-gradient(circle at 88% 12%, rgba(45, 212, 191, 0.12), transparent 38%),
        var(--bg-navy);
    color: var(--text-white);
    font-family: var(--font-base);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* 페이지 자체는 스크롤되지 않음 */
}

button { font-family: inherit; }
a { text-decoration: none; color: inherit; }

/* =========================
   앱 셸 / 브랜드 마크
========================= */

.app {
    height: 100vh;                       /* 구형 브라우저 fallback */
    height: calc(var(--app-vh, 1vh) * 100); /* JS로 측정한 실제 보이는 높이 (viewport-fit.js) */
    height: 100dvh;                      /* 최신 브라우저: 주소창 변화까지 반영한 실제 높이 */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 18px 14px;
    position: relative;
    overflow: hidden;
}

/* ---- PC 화면 전용 배경 장식 (블러 처리된 골드/민트 원, 은은한 플로팅) ---- */
.bg-deco {
    display: none;
    position: absolute;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
    z-index: 0;
}

@media (min-width: 860px) {
    .bg-deco { display: block; }
    .bg-deco.d1 {
        width: 460px; height: 460px;
        top: -160px; left: -140px;
        background: radial-gradient(circle, rgba(242,184,75,.16), transparent 70%);
        animation: floatSlow 12s ease-in-out infinite;
    }
    .bg-deco.d2 {
        width: 380px; height: 380px;
        bottom: -140px; right: -100px;
        background: radial-gradient(circle, rgba(45,212,191,.16), transparent 70%);
        animation: floatSlow 14s ease-in-out infinite reverse;
    }
    .bg-deco.d3 {
        width: 6px; height: 6px;
        top: 20%; right: 14%;
        background: var(--accent-gold);
        box-shadow: 0 0 24px 6px rgba(242,184,75,.5);
        animation: floatSlow 8s ease-in-out infinite;
    }
    .bg-deco.d4 {
        width: 5px; height: 5px;
        bottom: 22%; left: 12%;
        background: var(--accent-mint);
        box-shadow: 0 0 20px 5px rgba(45,212,191,.5);
        animation: floatSlow 10s ease-in-out infinite reverse;
    }
}

@keyframes floatSlow {
    0%, 100% { transform: translateY(0) translateX(0); }
    50% { transform: translateY(-18px) translateX(10px); }
}

.brand-mark, .stage { position: relative; z-index: 1; }

.brand-mark {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    flex: 0 0 auto;
    opacity: 0.92;
    transition: opacity .16s ease;
}

.brand-mark:hover { opacity: 1; }
.brand-mark img { height: 26px; width: auto; display: block; }

/* =========================
   STAGE (인트로/질문/결과가 모두 이 프레임 안에서 전환됨)
========================= */

.stage {
    width: 100%;
    max-width: 440px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    position: relative;
}

/* 결과 화면 전용: 카드 안에 더 볼 내용이 남아있을 때만 뜨는 스크롤 유도 화살표.
   .stage(스크롤되지 않는 바깥 박스) 기준으로 고정되어, 카드가 스크롤돼도 같이
   움직이지 않고 항상 카드 하단에 떠 있다가, 바닥에 닿으면 사라진다. */
.scroll-hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
    color: #9aa1b4;
    pointer-events: none;
    z-index: 5;
}

.scroll-hint svg { display: block; }

.scroll-hint.visible {
    display: flex;
    animation: scrollHintBounce 1.6s ease-in-out infinite;
}

@keyframes scrollHintBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: .5; }
    50% { transform: translateX(-50%) translateY(5px); opacity: .95; }
}

.stage-card {
    width: 100%;
    background: var(--card-white);
    border-radius: 26px;
    box-shadow: var(--shadow-stage);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

.stage-card::-webkit-scrollbar { display: none; }
.stage-card { scrollbar-width: none; -ms-overflow-style: none; }

.screen { display: none; }
.screen.active { display: flex; flex-direction: column; flex: 1; }

/* fade 전환 */
.screen.active { animation: fadeIn .32s ease; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================
   INTRO
========================= */

.intro-body {
    padding: 40px 26px 28px;
    text-align: center;
    margin: auto 0;
}

.fire-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-deep));
    box-shadow: 0 14px 28px rgba(217, 154, 43, .28);
}

.intro-body h1 {
    margin: 0;
    font-size: clamp(24px, 7vw, 32px);
    line-height: 1.28;
    font-weight: 800;
    letter-spacing: -0.9px;
    color: var(--text-dark);
}

.intro-body h1 span {
    color: var(--accent-mint-text);
}

.intro-hook {
    margin: 16px 0 0;
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--card-tint);
    color: var(--text-dark-muted);
    font-size: 13.5px;
    line-height: 1.6;
    text-align: left;
}

.intro-hook strong { color: var(--text-dark); font-weight: 700; }

.intro-desc {
    margin: 16px 0 22px;
    color: var(--text-dark-muted);
    font-size: 14px;
    line-height: 1.6;
}

.test-info {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.info-pill {
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--card-tint);
    color: var(--text-dark-muted);
    font-size: 12.5px;
    font-weight: 700;
}

.primary-btn {
    width: 100%;
    border: 0;
    border-radius: 15px;
    padding: 16px 20px;
    color: #1a1305;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-deep));
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s ease;
    box-shadow: 0 10px 22px rgba(217, 154, 43, .28);
}

.primary-btn:hover { transform: translateY(-2px); }
.primary-btn:active { transform: scale(.98); }

/* =========================
   TEST
========================= */

.test-header {
    padding: 22px 22px 14px;
    flex: 0 0 auto;
}

.progress-label {
    font-size: 12px;
    color: var(--text-dark-muted);
    font-weight: 700;
    margin-bottom: 9px;
    display: block;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: var(--card-tint);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-mint), var(--accent-gold));
    transition: width .4s ease;
}

.question-card {
    padding: 6px 22px 22px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.question-number {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    margin-bottom: 13px;
    border-radius: 999px;
    background: var(--accent-gold-dim);
    color: var(--accent-gold-deep);
    font-size: 12px;
    font-weight: 800;
    width: fit-content;
}

.question-title {
    margin: 0 0 20px;
    font-size: 19px;
    line-height: 1.42;
    letter-spacing: -.4px;
    font-weight: 800;
    color: var(--text-dark);
    word-break: keep-all;
    overflow-wrap: break-word;
}

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

.option {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    text-align: left;
    border: 1.5px solid var(--border-line-soft);
    background: var(--card-white);
    border-radius: 15px;
    padding: 13px 13px;
    cursor: pointer;
    transition: .16s ease;
    color: var(--text-dark);
}

.option:hover {
    border-color: var(--accent-mint);
    background: var(--card-tint);
    transform: translateY(-1px);
}

.option:active { transform: scale(.985); }

.option-letter {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-tint);
    color: var(--text-dark-muted);
    font-size: 12px;
    font-weight: 800;
}

.option-text {
    padding-top: 2px;
    font-size: 13.5px;
    line-height: 1.5;
    font-weight: 600;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 워터마크는 질문 카드의 '최하단'에 고정 (내용 길이와 무관하게 항상 카드 바닥) */
.question-watermark {
    margin-top: auto;
    padding-top: 18px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #c7cbd6;
}

/* =========================
   RESULT
========================= */

.result-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 모바일에서는 좀 더 존재감 있게, PC에서는 기존 컴팩트 비율 유지(하단 데스크톱 미디어쿼리에서 재정의) */
.result-image-wrap {
    width: 100%;
    aspect-ratio: 1.27 / 1;
    flex: 0 0 auto;
    background: var(--card-navy);
    position: relative;
    overflow: hidden;
}

.result-image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 55%, rgba(0,0,0,.14));
}

.result-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    z-index: 1;
}

.image-placeholder-icon { font-size: 34px; margin-bottom: 6px; }
.image-placeholder-text { font-size: 12.5px; font-weight: 600; }

.result-content { padding: 32px 26px 30px; }

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 20px;
    background: var(--accent-gold-dim);
    color: var(--accent-gold-deep);
}

/* 한국어 별명이 메인 타이틀 */
.result-name {
    margin: 0 0 24px;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -1px;
    font-weight: 800;
    color: var(--text-dark);
}

.result-summary {
    margin: 0;
    padding: 20px;
    border-radius: 14px;
    background: var(--card-tint);
    font-size: 14px;
    line-height: 1.65;
    font-weight: 700;
    color: var(--text-dark);
}

.result-description {
    margin: 26px 0 0;
    color: var(--text-dark-muted);
    font-size: 13.5px;
    line-height: 1.8;
}

/* ---- 포트폴리오 팁 (기존 점수 박스 대체) ---- */
.tips-box {
    margin-top: 28px;
    padding: 22px 20px 20px;
    border-radius: 16px;
    background: var(--bg-navy);
    color: var(--text-white);
}

.tips-title {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--accent-gold);
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tips-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
}

.tips-list li::before {
    content: "";
    flex: 0 0 5px;
    width: 5px;
    height: 5px;
    margin-top: 7px;
    border-radius: 50%;
    background: var(--accent-mint);
}

/* =========================
   CTA
========================= */

.cta-section {
    margin-top: 26px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.cta-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-line-soft);
    background: var(--card-white);
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-dark);
    transition: .16s ease;
}

.cta-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.cta-btn .arrow { font-size: 17px; color: #b3b8c4; }

.cta-backtest { border-color: rgba(45,212,191,.3); background: var(--accent-mint-dim); }
.cta-dividend { border-color: rgba(242,184,75,.35); background: var(--accent-gold-dim); }

/* =========================
   SHARE
========================= */

.share-section {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border-line-soft);
}

.share-title {
    margin: 0 0 11px;
    font-size: 13px;
    font-weight: 800;
    color: var(--text-dark);
    text-align: center;
}

.share-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.share-btn {
    border: 0;
    border-radius: 12px;
    padding: 13px 10px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 800;
}

.share-kakao { background: #fee500; color: #191919; }
.share-copy { background: var(--card-tint); color: var(--text-dark); }

.restart-btn {
    display: block;
    width: 100%;
    margin-top: 10px;
    border: 0;
    background: transparent;
    color: var(--text-dark-muted);
    padding: 11px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    text-align: center;
}

.disclaimer {
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
    color: #a9afc2;
    line-height: 1.5;
}

/* =========================
   DESKTOP / TALLER VIEWPORT
========================= */

@media (min-width: 480px) and (min-height: 760px) {
    .stage { max-width: 460px; }
    .intro-body { padding: 52px 34px 34px; }
    .question-card { padding: 8px 30px 26px; }
    .question-title { font-size: 21px; }
    .result-content { padding: 30px 28px 26px; }
}

@media (max-height: 620px) {
    .fire-icon { width: 54px; height: 54px; font-size: 28px; margin-bottom: 14px; }
    .intro-body { padding: 26px 22px 20px; }
    .intro-hook { display: none; }
}

/* =========================
   PC(데스크톱) 전용 UI
========================= */

@media (min-width: 860px) {

    .app { padding: 32px; }

    .brand-mark { margin-bottom: 22px; }
    .brand-mark img { height: 30px; }

    .stage {
        max-width: 560px;
        max-height: 780px;
    }

    .stage-card {
        border-radius: 32px;
        box-shadow: 0 40px 90px rgba(3, 6, 14, 0.5), 0 0 0 1px rgba(242,184,75,.06);
    }

    /* PC에서는 기존의 컴팩트한 이미지 비율로 (모바일만 세로로 키움) */
    .result-image-wrap { aspect-ratio: 1.4 / 1; }

    /* ---- 인트로 ---- */
    .intro-body { padding: 64px 52px 44px; }
    .fire-icon { width: 84px; height: 84px; font-size: 42px; border-radius: 24px; margin-bottom: 24px; }
    .intro-body h1 { font-size: 36px; letter-spacing: -1.3px; }
    .intro-hook { font-size: 14.5px; padding: 16px 18px; margin-top: 20px; }
    .intro-desc { font-size: 15px; margin: 20px 0 26px; }
    .info-pill { font-size: 13px; padding: 8px 14px; }
    .primary-btn { padding: 18px 22px; font-size: 16px; border-radius: 16px; }
    .primary-btn:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(217,154,43,.34); }

    /* ---- 질문 ---- */
    .test-header { padding: 32px 34px 18px; }
    .question-card { padding: 8px 34px 30px; }
    .question-title { font-size: 24px; margin-bottom: 26px; }
    .question-number { font-size: 12.5px; padding: 6px 12px; }

    .options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .option { padding: 16px 15px; border-radius: 16px; }
    .option:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.08); }
    .option-text { font-size: 14px; }

    /* ---- 결과 ---- */
    .result-content { padding: 38px 38px 34px; }
    .result-name { font-size: 36px; }
    .result-summary { font-size: 15px; padding: 19px; }
    .result-description { font-size: 14.5px; }

    .cta-btn { padding: 17px 18px; font-size: 14.5px; }
    .cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15,23,42,.1); }

    .share-btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
    .share-btn { transition: .15s ease; }
}
