/* ====== Root tokens inspired by harrypotter.com dark / gold / editorial vibe ====== */
/* 사이트는 짙은 어두운 배경 위에 콘텐트 카드가 약간 더 밝은 남색/먹색 톤,
   중요한 텍스트나 액션은 금빛/브론즈 톤을 강조하는 식이다. :contentReference[oaicite:1]{index=1} */

:root {
    /* Background & surfaces */
    --bg: #0a0c10;
    /* 거의 블랙에 가까운 남청색 느낌 */
    --panel: #1a1f2a;
    /* 카드/콘텐츠 영역의 짙은 남색 계열 */
    --panel-soft: rgba(26, 31, 42, 0.6);

    /* Borders & lines */
    --line: rgba(255, 255, 255, 0.07);
    --line-strong: rgba(255, 255, 255, 0.12);

    /* Text colors */
    --text-main: #f8f8f5;
    /* 아주 밝은 아이보리/백색 */
    --text-dim: #a7a7a0;
    /* 흐린 회백/은색 */
    --accent-gold: #c7a44a;
    /* 금빛 톤 (하우스 문장/호그와트 장식에서 자주 보이는 골드 계열) :contentReference[oaicite:2]{index=2} */

    /* Radii & shadows */
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;

    --shadow-deep: 0 28px 64px rgba(0, 0, 0, 0.9);
    --shadow-card: 0 24px 48px rgba(0, 0, 0, 0.75);

    /* Fonts:
     헤드라인은 세리프(마법세계 책 느낌),
     본문은 산세리프로 가독성.
     harrypotter.com은 에디토리얼 헤드라인이 클래식하게 보이게 자간/대문자 처리한다. :contentReference[oaicite:3]{index=3}
  */
    --font-serif: "Georgia", "Times New Roman", Times, serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Pretendard", "Noto Sans KR", "Inter", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ====== Reset-ish / base ====== */

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    padding: 24px;
    display: flex;
    justify-content: center;
}

main {
    width: 100%;
    max-width: 900px;
    display: grid;
    gap: 24px;
}

/* ====== Typography helpers ====== */

.heading-serif {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-main);
}

.body-text {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-main);
}

.body-dim {
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-dim);
}

.accent-text {
    font-family: var(--font-serif);
    font-weight: 600;
    color: var(--accent-gold);
    letter-spacing: 0.03em;
    font-size: 0.8rem;
    line-height: 1.2;
    text-transform: uppercase;
}

/* ====== Header / Intro ====== */

header.app-header {
    text-align: center;
}

.title {
    font-size: clamp(1.6rem, 1vw + 1rem, 2rem);
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--text-main);
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.subtitle {
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: center;
    max-width: 480px;
    color: var(--text-dim);
}

/* ====== Card / Sections ====== */

.card {
    background-color: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
    padding: 24px;
    position: relative;
}

/* subtle top edge highlight like a rim-light */
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: radial-gradient(circle at 50% 0%,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(0, 0, 0, 0) 60%);
    pointer-events: none;
}

/* ====== Question blocks ====== */

.question-block {
    background-color: var(--panel-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 20px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-deep);
    position: relative;
}

/* a faint gold-ish top border strip to feel 'ornamental' */
.question-block::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
            rgba(199, 164, 74, 0) 0%,
            rgba(199, 164, 74, 0.6) 30%,
            rgba(199, 164, 74, 0.9) 50%,
            rgba(199, 164, 74, 0.6) 70%,
            rgba(199, 164, 74, 0) 100%);
    box-shadow: 0 0 8px rgba(199, 164, 74, 0.6);
}

.question-block:last-child {
    margin-bottom: 0;
}

.question-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
}

.question-label {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.q-hint {
    font-size: 0.7rem;
    line-height: 1.4;
    color: var(--text-dim);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* ====== Options ====== */

.options {
    display: grid;
    gap: 10px;
}

.option-row {
    display: flex;
    align-items: flex-start;
    border: 1px solid var(--line-strong);
    background-color: rgba(15, 16, 22, 0.6);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.12s, border 0.12s, box-shadow 0.12s;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.8);
}

.option-row:hover {
    background-color: rgba(30, 32, 44, 0.8);
    border-color: var(--accent-gold);
    box-shadow: 0 24px 42px rgba(0, 0, 0, 0.9),
        0 0 12px rgba(199, 164, 74, 0.4);
}

.option-input {
    margin: 3px 10px 0 0;
    flex-shrink: 0;
    accent-color: var(--accent-gold);
    width: 18px;
    height: 18px;
    cursor: pointer;
    filter: drop-shadow(0 0 4px rgba(199, 164, 74, 0.5));
}

.option-text-wrap {
    display: grid;
    gap: 4px;
}

.option-text {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
    word-break: keep-all;
    font-family: var(--font-sans);
}

/* ====== Action / Result area ====== */

.action-area {
    display: grid;
    gap: 16px;
    text-align: center;
}

.cta-button {
    appearance: none;
    border: 0;
    background: radial-gradient(circle at 50% 0%,
            rgba(255, 255, 255, 0.25) 0%,
            rgba(255, 255, 255, 0) 60%),
        linear-gradient(to bottom,
            rgba(199, 164, 74, 1) 0%,
            rgba(148, 114, 40, 1) 100%);
    color: #0a0c10;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow:
        0 24px 48px rgba(0, 0, 0, 0.9),
        0 0 16px rgba(199, 164, 74, 0.7);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.8);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition: filter 0.12s, box-shadow 0.12s;
}

.cta-button:hover {
    filter: brightness(1.05);
    box-shadow:
        0 28px 56px rgba(0, 0, 0, 0.95),
        0 0 20px rgba(199, 164, 74, 0.9);
}

.warning {
    display: none;
    background-color: rgba(255, 77, 77, 0.07);
    color: #ff6464;
    border: 1px solid rgba(255, 100, 100, 0.4);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    line-height: 1.4;
    padding: 10px 12px;
    text-align: center;
    font-weight: 500;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.8);
    font-family: var(--font-sans);
}

.result-card {
    display: none;
    background-color: rgba(10, 12, 16, 0.6);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: left;
    position: relative;
    box-shadow: var(--shadow-deep);
}

.result-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg,
            rgba(199, 164, 74, 0) 0%,
            rgba(199, 164, 74, 0.6) 30%,
            rgba(199, 164, 74, 0.9) 50%,
            rgba(199, 164, 74, 0.6) 70%,
            rgba(199, 164, 74, 0) 100%);
    box-shadow: 0 0 8px rgba(199, 164, 74, 0.6);
}

.result-house {
    font-size: 1.1rem;
    margin-bottom: 6px;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(199, 164, 74, 0.5);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.result-scoreline {
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
    white-space: pre-line;
    color: var(--text-dim);
    font-family: var(--font-sans);
}

.result-desc-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-gold);
    margin-bottom: 6px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(199, 164, 74, 0.4);
}

.result-desc-body {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.5;
    white-space: pre-line;
    font-family: var(--font-sans);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* ====== Footer ====== */

.footer-note {
    text-align: center;
    font-size: 0.7rem;
    padding-bottom: 32px;
    line-height: 1.4;
    color: var(--text-dim);
    font-family: var(--font-sans);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

/* ====== Responsive ====== */

@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .question-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* 한 문제씩 보기용 */
.hidden {
    display: none;
}

/* 진행 카드 */
.progress-card {
    display: grid;
    gap: 12px;
    text-align: left;
}

.progress-top {
    display: grid;
    gap: 8px;
}

.progress-label {
    font-size: 1rem;
    color: var(--accent-gold);
    text-shadow: 0 0 8px rgba(199, 164, 74, 0.5);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.progress-bar-outer {
    width: 100%;
    height: 6px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.8);
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(to right,
            rgba(199, 164, 74, 1) 0%,
            rgba(148, 114, 40, 1) 100%);
    width: 0%;
    transition: width 0.15s ease-out;
    box-shadow: 0 0 12px rgba(199, 164, 74, 0.8);
}

/* 이전/다음 버튼 */
.nav-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.nav-button {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background-color: rgba(30, 32, 44, 0.8);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    cursor: pointer;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    min-width: 90px;
    text-align: center;
    box-shadow:
        0 20px 36px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(255, 255, 255, 0.05);
    transition: background-color 0.12s, box-shadow 0.12s, border 0.12s;
}

.nav-button:hover:not(:disabled) {
    background-color: rgba(50, 54, 72, 0.9);
    border-color: var(--accent-gold);
    box-shadow:
        0 24px 42px rgba(0, 0, 0, 1),
        0 0 12px rgba(199, 164, 74, 0.4);
}

.nav-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.07);
}

.result-image-wrap {
    margin: 16px auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    box-shadow:
        0 24px 42px rgba(0, 0, 0, 0.9),
        0 0 16px rgba(255, 255, 255, 0.07);
    max-width: 220px;
}

.result-image {
    max-width: 180px;
    max-height: 180px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
}