/* --- 기본 설정 및 변수 --- */
:root {
    --bg-color: #020412;
    --panel-bg: rgba(15, 20, 50, 0.4);
    --panel-border: rgba(100, 150, 255, 0.2);
    --text-primary: #e0e8ff;
    --text-secondary: #a0b0d0;
    --accent-color: #4dd0e1;
    --accent-glow: rgba(77, 208, 225, 0.3);
    --font-title: 'Cinzel', serif;
    --font-body: 'Quicksand', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    background-image: url('https://images.unsplash.com/photo-1534796636912-3b95b3ab5986?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2071&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    font-family: var(--font-body);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* --- 마우스 커서 별무리 효과 --- */
#stardust-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* --- 메인 레이아웃 --- */
.hub-container {
    display: flex;
    height: 100vh;
    padding: 2rem;
    gap: 2rem;
    backdrop-filter: blur(2px) brightness(0.9);
}

/* --- 왼쪽: 스토리 목록 --- */
.story-list {
    width: 380px;
    min-width: 320px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
}

.list-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid var(--panel-border);
}

.list-header h1 {
    font-family: var(--font-title);
    font-size: 2rem;
    letter-spacing: 2px;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}

.list-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

#list-container {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 1rem 0;
}

.list-item {
    padding: 1rem 2rem;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s ease;
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background-color: var(--accent-color);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.list-item:hover, .list-item.active {
    background-color: rgba(77, 208, 225, 0.05);
}

.list-item:hover::before, .list-item.active::before {
    height: 80%;
}

.item-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
}
.item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* --- 오른쪽: 상세 뷰어 --- */
.detail-viewer {
    flex-grow: 1;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    padding: 3rem;
    overflow-y: auto;
    transition: opacity 0.5s ease;
}
.detail-viewer.is-changing {
    opacity: 0;
}

.initial-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-secondary);
}
.initial-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: float 4s ease-in-out infinite;
}
.initial-state h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.content-state.hidden, .initial-state.hidden {
    display: none;
}
.content-state {
    display: flex;
    gap: 2rem;
}

#detail-image {
    width: 300px;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    flex-shrink: 0;
}

#detail-title {
    font-family: var(--font-title);
    font-size: 3rem;
    line-height: 1.1;
    color: var(--accent-color);
    text-shadow: 0 0 10px var(--accent-glow);
}
#detail-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.tags span {
    background: var(--accent-glow);
    color: var(--accent-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
#detail-description {
    line-height: 1.7;
    margin-bottom: 2rem;
}
.launch-btn {
    display: inline-block;
    background: var(--accent-color);
    color: var(--bg-color);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 15px var(--accent-glow);
}
.launch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px var(--accent-glow);
}
.launch-btn.disabled {
    background-color: #546e7a;
    color: var(--text-secondary);
    cursor: not-allowed;
    box-shadow: none;
}

/* --- 스크롤바 커스텀 --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #80deea; }

/* --- 반응형 디자인 --- */
@media (max-width: 1024px) {
    .hub-container {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    .story-list {
        width: 100%;
        height: 40%;
        min-height: 250px;
    }
    .detail-viewer {
        height: 60%;
        padding: 2rem;
    }
    .content-state {
        flex-direction: column;
    }
    #detail-image {
        width: 100%;
        height: 200px;
        margin-bottom: 1rem;
    }
    #detail-title { font-size: 2rem; }
}