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

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

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

body {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    background: #0d0221;
    color: #fff;
}

#bg-layer {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0d0221;
    transition: background 1.8s ease;
    z-index: 0;
}

#neuro-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
    pointer-events: none;
}

#progress-bar {
    position: fixed; top: 60px; left: 0;
    height: 2px;
    background: linear-gradient(90deg, #9b5cf6, #e040fb);
    z-index: 300;
    width: 0%;
    transition: width 0.6s ease;
}

#sound-toggle {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; z-index: 200; transition: all 0.3s;
}
#sound-toggle:hover { background: rgba(255,255,255,0.09); color: rgba(255,255,255,0.8); }

#slides-container {
    position: fixed; top: 60px; left: 0;
    width: 100%; height: calc(100vh - 60px);
    z-index: 10;
}

.slide {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 2rem 1.5rem;
    opacity: 0;
    transform: translateY(55px);
    transition: opacity 0.65s ease, transform 0.65s ease;
    pointer-events: none;
    overflow-y: auto;
}
.slide.active      { opacity: 1; transform: translateY(0); pointer-events: all; }
.slide.exit-up     { opacity: 0; transform: translateY(-55px); pointer-events: none; }

#intro-slide { gap: 1.4rem; text-align: center; }

.intro-eyebrow {
    font-size: 0.72rem; letter-spacing: 0.4em;
    color: rgba(200,160,255,0.35); text-transform: uppercase;
}

.intro-title {
    font-family: 'Black Han Sans', sans-serif;
    font-size: clamp(1.7rem, 5.5vw, 2.8rem);
    line-height: 1.35;
    color: #fff;
    text-shadow: 0 0 50px rgba(155,92,246,0.6);
}
.intro-title em { color: #c77dff; font-style: normal; }

.intro-sub {
    font-size: 0.95rem; font-weight: 300;
    color: rgba(255,255,255,0.45);
    max-width: 360px; line-height: 1.7;
}

.intro-narrative {
    font-size: 0.88rem;
    color: rgba(210,190,255,0.6);
    max-width: 340px; line-height: 1.9;
    border-left: 2px solid rgba(155,92,246,0.35);
    padding-left: 1rem; text-align: left;
}

#start-btn {
    margin-top: 0.5rem;
    padding: 0.95rem 2.5rem;
    background: transparent;
    border: 1px solid rgba(200,160,255,0.35);
    border-radius: 50px;
    color: #c77dff;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 1.05rem;
    cursor: pointer;
    letter-spacing: 0.06em;
    transition: all 0.35s ease;
    position: relative; overflow: hidden;
}
#start-btn::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(200,160,255,0.08);
    border-radius: 50%;
    transform: translate(-50%,-50%);
    transition: width 0.6s, height 0.6s;
}
#start-btn:hover::before { width: 320px; height: 320px; }
#start-btn:hover {
    border-color: rgba(200,160,255,0.7);
    box-shadow: 0 0 25px rgba(200,160,255,0.18);
}

.q-inner {
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
}

.step-badge {
    font-size: 0.7rem; letter-spacing: 0.35em;
    color: rgba(255,255,255,0.25); text-transform: uppercase;
    align-self: flex-start;
}

.step-narrative {
    font-size: 0.82rem;
    color: rgba(200,175,255,0.55);
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.question-text {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    font-size: clamp(1.2rem, 3.4vw, 1.7rem);
    line-height: 1.7; color: #fff; text-align: center;
}

.options-container { display: flex; flex-direction: column; gap: 0.7rem; width: 100%; }

.opt-btn {
    width: 100%;
    padding: 1rem 1.2rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: rgba(255,255,255,0.82);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.97rem;
    cursor: pointer;
    display: flex; align-items: center; gap: 0.9rem;
    text-align: left; line-height: 1.5;
    transition: all 0.28s ease;
}

.opt-label {
    min-width: 1.7rem; height: 1.7rem; line-height: 1.7rem;
    text-align: center; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    font-size: 0.78rem; font-weight: 400;
    flex-shrink: 0; color: rgba(255,255,255,0.6);
    transition: all 0.28s;
}

.opt-btn:hover:not(:disabled) {
    background: rgba(200,160,255,0.08);
    border-color: rgba(200,160,255,0.35);
    transform: translateX(5px);
}
.opt-btn:hover:not(:disabled) .opt-label {
    background: rgba(200,160,255,0.25); color: #fff;
}
.opt-btn.selected {
    background: rgba(200,120,255,0.12);
    border-color: rgba(200,120,255,0.5);
}
.opt-btn.selected .opt-label {
    background: #c77dff; color: #000;
}
.opt-btn.not-selected { opacity: 0.38; }

.vote-section {
    width: 100%;
    padding: 1rem 1.1rem;
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
}
.vote-title {
    font-size: 0.75rem; color: rgba(255,255,255,0.3);
    margin-bottom: 0.7rem; letter-spacing: 0.08em;
}
.vote-row {
    display: flex; align-items: center; gap: 0.7rem;
    margin-bottom: 0.45rem;
}
.vote-row:last-child { margin-bottom: 0; }
.vote-lbl {
    font-size: 0.75rem; font-weight: 400;
    color: rgba(255,255,255,0.35); min-width: 1rem;
}
.vote-bar-bg {
    flex: 1; height: 5px;
    background: rgba(255,255,255,0.07);
    border-radius: 3px; overflow: hidden;
}
.vote-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9b5cf6, #e040fb);
    border-radius: 3px; width: 0%;
    transition: width 0.85s cubic-bezier(0.4,0,0.2,1);
}
.vote-row.faded .vote-bar-fill { background: rgba(255,255,255,0.15); }
.vote-pct {
    font-size: 0.82rem; font-weight: 400;
    color: #9b5cf6; min-width: 2.4rem; text-align: right;
}
.vote-row.faded .vote-pct { color: rgba(255,255,255,0.25); }

.next-btn {
    width: 100%; padding: 0.85rem;
    background: transparent;
    border: 1px solid rgba(200,160,255,0.25);
    border-radius: 10px;
    color: rgba(200,160,255,0.7);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.97rem; cursor: pointer;
    transition: all 0.3s; letter-spacing: 0.04em;
}
.next-btn:hover {
    background: rgba(200,160,255,0.08);
    border-color: rgba(200,160,255,0.55);
    color: #c77dff;
}

#analyzing-slide { gap: 1.8rem; text-align: center; }

.analyzing-orb {
    width: 90px; height: 90px; border-radius: 50%;
    background: radial-gradient(circle at 32% 32%, #c77dff, #3a0068);
    animation: orbPulse 2.2s ease-in-out infinite;
    box-shadow: 0 0 55px rgba(200,100,255,0.4);
    flex-shrink: 0;
}
@keyframes orbPulse {
    0%,100% { transform: scale(1);    box-shadow: 0 0 55px rgba(200,100,255,0.4); }
    50%      { transform: scale(1.12); box-shadow: 0 0 85px rgba(200,100,255,0.65); }
}

.analyzing-label {
    font-family: 'Black Han Sans', sans-serif;
    font-size: 1.4rem; color: #c77dff;
}
.analyzing-sub {
    font-size: 0.88rem; color: rgba(255,255,255,0.35);
    line-height: 1.7; max-width: 280px;
}

#result-slide {
    padding-top: 3rem; padding-bottom: 3rem;
}

.result-inner {
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    text-align: center;
}

.result-eyebrow {
    font-size: 0.7rem; letter-spacing: 0.4em;
    color: rgba(255,255,255,0.25); text-transform: uppercase;
}
.result-title {
    font-family: 'Black Han Sans', sans-serif;
    font-size: clamp(1.45rem, 4vw, 2.1rem);
    color: #fff;
    text-shadow: 0 0 40px rgba(200,100,255,0.45);
}
.result-card {
    background: rgba(255,255,255,0.025);
    border: 1px solid rgba(200,155,255,0.12);
    border-radius: 16px;
    padding: 1.5rem 1.4rem;
    text-align: left;
    font-size: 1.02rem; line-height: 1.95;
    color: rgba(255,255,255,0.82);
    min-height: 100px; width: 100%;
    white-space: pre-wrap;
}
.result-type-badge {
    display: inline-block;
    padding: 0.6rem 1.4rem;
    background: rgba(155,92,246,0.1);
    border: 1px solid rgba(155,92,246,0.3);
    border-radius: 50px;
    font-size: 0.95rem; color: #c77dff; font-weight: 400;
}
.result-actions { display: flex; gap: 0.75rem; width: 100%; }

.result-actions button {
    flex: 1; padding: 0.88rem;
    border-radius: 10px; border: none;
    cursor: pointer;
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.97rem; font-weight: 400;
    transition: all 0.3s;
}
#share-btn { background: #9b5cf6; color: #fff; }
#share-btn:hover { background: #8b4fe0; }
#retry-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.13) !important;
    color: rgba(255,255,255,0.6);
}
#retry-btn:hover { background: rgba(255,255,255,0.09); }

.hidden { display: none !important; }

.typing::after {
    content: '▌';
    animation: blink 0.75s infinite;
    color: #c77dff;
}
@keyframes blink {
    0%,49% { opacity: 1; } 50%,100% { opacity: 0; }
}

::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }

@media (max-width: 480px) {
    .slide { padding: 1.4rem 1rem; }
    .question-text { font-size: 1.12rem; }
    .opt-btn { font-size: 0.88rem; padding: 0.85rem 1rem; }
    .result-card { font-size: 0.95rem; }
}
