/* 온보딩 래퍼 */
.onboarding-wrapper {
    width: 100%;
    min-height: calc(100vh - 88px);
    position: relative;
    padding: 40px 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 우주 배경 컨테이너 */
.cosmic-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* 성운 효과 */
.nebula {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, 
        hsla(var(--hue, 260), 70%, 60%, 0.15) 0%,
        hsla(var(--hue, 260), 70%, 50%, 0.1) 30%,
        transparent 70%);
    filter: blur(60px);
    animation: nebulaFloat 20s ease-in-out infinite;
    transform: translate(-50%, -50%);
}

@keyframes nebulaFloat {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 0.5;
    }
}

/* 블랙홀 효과 */
.black-hole {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse at center,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.6) 20%,
        rgba(26, 37, 48, 0.3) 40%,
        rgba(26, 37, 48, 0.1) 60%,
        transparent 80%);
    filter: blur(40px);
    animation: blackHolePulse 8s ease-in-out infinite;
    transform: translate(-50%, -50%);
    box-shadow: 
        0 0 100px rgba(0, 0, 0, 0.8),
        inset 0 0 80px rgba(26, 37, 48, 0.4);
}

@keyframes blackHolePulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.6;
    }
}

.black-hole::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: radial-gradient(circle at center,
        rgba(26, 37, 48, 0.2) 0%,
        transparent 70%);
    transform: translate(-50%, -50%);
    animation: blackHoleRotate 10s linear infinite;
}

@keyframes blackHoleRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 날아다니는 별 컨테이너 */
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 개별 별 */
.floating-star {
    position: absolute;
    background: rgba(53, 64, 80, 0.9);
    border-radius: 50%;
    box-shadow: 
        0 0 8px rgba(53, 64, 80, 0.8), 
        0 0 16px rgba(37, 48, 64, 0.6), 
        0 0 24px rgba(37, 48, 64, 0.3),
        0 0 40px rgba(53, 64, 80, 0.2);
    animation: floatStar linear infinite;
}

.floating-star.shooting {
    box-shadow: 
        0 0 12px rgba(53, 64, 80, 1), 
        0 0 24px rgba(37, 48, 64, 0.8), 
        0 0 40px rgba(37, 48, 64, 0.5),
        0 0 60px rgba(53, 64, 80, 0.3);
}

.floating-star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 50%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px rgba(255, 255, 255, 1);
}

.floating-star.shooting::before {
    box-shadow: 0 0 12px rgba(255, 255, 255, 1), 0 0 20px rgba(53, 64, 80, 0.8);
}

.floating-star::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(53, 64, 80, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: starPulse 2s ease-in-out infinite;
}

.floating-star.shooting::after {
    width: 300%;
    height: 300%;
    background: radial-gradient(ellipse at center, rgba(53, 64, 80, 0.4) 0%, transparent 60%);
    animation: starPulse 1s ease-in-out infinite;
}

@keyframes floatStar {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--move-x, 100vw) * 0.5), calc(var(--move-y, -100vh) * 0.5)) scale(1.2) rotate(180deg);
    }
    95% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--move-x, 100vw), var(--move-y, -100vh)) scale(0.3) rotate(360deg);
        opacity: 0;
    }
}

.floating-star.shooting {
    animation: shootingStar linear infinite;
}

@keyframes shootingStar {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
        filter: blur(0px);
    }
    5% {
        opacity: 1;
    }
    50% {
        transform: translate(calc(var(--move-x, 100vw) * 0.5), calc(var(--move-y, -100vh) * 0.5)) scale(1.5);
        filter: blur(2px);
    }
    95% {
        opacity: 1;
        filter: blur(1px);
    }
    100% {
        transform: translate(var(--move-x, 100vw), var(--move-y, -100vh)) scale(0.2);
        opacity: 0;
        filter: blur(3px);
    }
}

@keyframes starPulse {
    0%, 100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* 온보딩 컨테이너 */
.onboarding-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.onboarding-title {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #eaecee 0%, #edebeb 50%, #ebeef0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: -40px;
    margin-bottom: 16px;
    letter-spacing: -1px;
    text-shadow: 0 0 40px rgba(53, 64, 80, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
    position: relative;
}

.onboarding-title::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(53, 64, 80, 0.3), transparent);
    filter: blur(30px);
    animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(53, 64, 80, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 40px rgba(53, 64, 80, 0.8));
    }
}

@keyframes titlePulse {
    0%, 100% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.2);
    }
}

.onboarding-subtitle {
    text-align: center;
    font-size: 16px;
    color: #ffffff;
    margin-bottom: 50px;
    font-weight: 400;
    text-shadow: 0 0 20px rgba(53, 64, 80, 0.3);
}

/* 카테고리 그리드 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    max-width: 650px;
    margin: 0 auto;
}

/* 카테고리 카드 */
.category-card {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(37, 48, 64, 0.3);
    box-shadow: 0 0 40px rgba(26, 37, 48, 0.2), 0 20px 60px rgba(0, 0, 0, 0.3);
}

.category-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(53, 64, 80, 0.1) 0%, transparent 70%);
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.category-card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: rgba(53, 64, 80, 0.6);
    box-shadow: 0 0 60px var(--glow-color, rgba(37, 48, 64, 0.4)), 0 30px 80px rgba(0, 0, 0, 0.4);
}

.category-card:active {
    transform: translateY(-8px) scale(1);
}

/* 카테고리 이미지 영역 */
.category-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 커뮤니티 카드에 이미지 표시 */
.category-card[data-category="community"] .category-image {
    background-image: url('https://www.elespace.io/wiki/page/e/file/thumbnail/view/1232/e_template;jsessionid=230CFC624B675619AAB33D80C64542B0') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* 커뮤니티 카드의 모든 오버레이 제거 */
.category-card[data-category="community"] .category-glow {
    display: none !important;
}

.category-card[data-category="community"] .category-image-overlay {
    display: none !important;
}

.category-card[data-category="community"] .category-image::before {
    display: none !important;
}

.category-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(53, 64, 80, 0.2), transparent);
    animation: pulseGlow 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.2);
    }
}

.category-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(53, 64, 80, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(37, 48, 64, 0.15) 0%, transparent 50%);
    z-index: 1;
}

/* 이미지가 있는 경우 ::before 오버레이 숨기기 */
.category-image[data-has-image="true"]::before {
    display: none;
}

.category-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 37, 48, 0.15) 0%, rgba(37, 48, 64, 0.1) 50%, rgba(53, 64, 80, 0.15) 100%);
    z-index: 2;
    pointer-events: none;
}

/* 커뮤니티 카드의 오버레이 더 투명하게 */
.category-card[data-category="community"] .category-image-overlay {
    background: linear-gradient(135deg, rgba(26, 37, 48, 0.1) 0%, rgba(37, 48, 64, 0.05) 50%, rgba(53, 64, 80, 0.1) 100%);
}

.category-card[data-category="random-planet"] {
    opacity: 0.8;
    filter: grayscale(40%) brightness(0.8);
    cursor: not-allowed;
}

.category-card[data-category="random-planet"]:hover {
    transform: none;
    opacity: 0.9;
    box-shadow: 0 0 40px rgba(26, 37, 48, 0.1), 0 20px 60px rgba(0, 0, 0, 0.2);
    border-color: rgba(37, 48, 64, 0.2);
}

.category-card[data-category="community"] {
    opacity: 0.8;
    filter: grayscale(40%) brightness(0.8);
}

.category-card[data-category="community"]:hover {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 40px rgba(26, 37, 48, 0.1), 0 20px 60px rgba(0, 0, 0, 0.2);
    border-color: rgba(37, 48, 64, 0.2);
}

.category-card[data-category="random-planet"] .category-image::before {
    background: 
        radial-gradient(circle at 30% 40%, rgba(26, 37, 48, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 60%, rgba(37, 48, 64, 0.1) 0%, transparent 50%),
        rgba(0, 0, 0, 0.3);
}

/* 오버레이 */
.category-overlay {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 20px;
}

.category-icon {
    font-size: 60px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(53, 64, 80, 0.6)) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
    line-height: 1;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1) rotate(0deg);
    }
    25% {
        transform: translateY(-15px) scale(1.05) rotate(2deg);
    }
    50% {
        transform: translateY(-20px) scale(1.08) rotate(0deg);
    }
    75% {
        transform: translateY(-15px) scale(1.05) rotate(-2deg);
    }
}

.category-name {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 0 30px rgba(53, 64, 80, 0.8), 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #B8C0C8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-description {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 0 0 20px rgba(53, 64, 80, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 12px;
    line-height: 1.6;
    color: #B8C0C8;
}

/* 추후 개발 예정 배지 */
.coming-soon-badge {
    display: inline-block;
    padding: 8px 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-shadow: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.4);
    opacity: 0.8;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .onboarding-container {
        padding-top: 30px;
    }

    .onboarding-title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .onboarding-subtitle {
        font-size: 14px;
        margin-bottom: 40px;
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .category-card {
        height: 240px;
    }

    .category-icon {
        font-size: 48px;
        margin-bottom: 10px;
    }

    .category-name {
        font-size: 20px;
        margin-bottom: 6px;
    }

    .category-description {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .coming-soon-badge {
        padding: 6px 16px;
        font-size: 11px;
    }
}

/* 사용설명서 섹션 */
.manual-section {
    margin-top: 80px;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

.manual-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
}

.manual-icon {
    font-size: 60px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(53, 64, 80, 0.6));
    display: inline-block;
}

.manual-title {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, #889098 0%, #B8C0C8 50%, #889098 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -1px;
    text-shadow: 0 0 40px rgba(53, 64, 80, 0.5);
    animation: titleGlow 3s ease-in-out infinite;
}

.manual-subtitle {
    font-size: 16px;
    color: #889098;
    font-weight: 400;
    opacity: 0.9;
    text-shadow: 0 0 20px rgba(53, 64, 80, 0.3);
}

.manual-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
}

.manual-card {
    background: rgba(97, 109, 124, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(37, 48, 64, 0.3);
    border-radius: 20px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 40px rgba(26, 37, 48, 0.3),
        0 20px 60px rgba(15, 22, 30, 0.4),
        inset 0 1px 0 rgba(64, 74, 85, 0.1);
}

.manual-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(53, 64, 80, 0.1) 0%, transparent 70%);
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
}

.manual-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(53, 64, 80, 0.6);
    box-shadow: 
        0 0 60px rgba(53, 64, 80, 0.5),
        0 30px 80px rgba(15, 22, 30, 0.5),
        inset 0 1px 0 rgba(64, 74, 85, 0.2);
    background: rgba(97, 109, 124, 0.5);
}

.manual-card-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(53, 64, 80, 0.5));
}

.manual-card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #B8C0C8;
    text-shadow: 0 0 20px rgba(53, 64, 80, 0.5);
    letter-spacing: -0.5px;
}

.manual-card-description {
    font-size: 14px;
    color: #889098;
    line-height: 1.6;
    margin-bottom: 24px;
    opacity: 0.9;
    text-shadow: 0 0 10px rgba(53, 64, 80, 0.3);
}

.manual-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(90deg, rgba(26, 37, 48, 0.15) 0%, rgba(37, 48, 64, 0.1) 100%);
    border-radius: 10px;
    border: 1px solid rgba(37, 48, 64, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.step-item:hover {
    background: linear-gradient(90deg, rgba(26, 37, 48, 0.25) 0%, rgba(37, 48, 64, 0.2) 100%);
    border-color: rgba(53, 64, 80, 0.5);
    transform: translateX(8px);
    box-shadow: 
        0 0 25px rgba(53, 64, 80, 0.4),
        0 4px 15px rgba(15, 22, 30, 0.3);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d4a6f 0%, #3d5a7f 50%, #4a6fa5 100%);
    color: white;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 
        0 0 20px rgba(53, 64, 80, 0.6),
        inset 0 2px 5px rgba(107, 141, 184, 0.3);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-item:hover .step-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 
        0 0 30px rgba(53, 64, 80, 0.8),
        inset 0 2px 5px rgba(107, 141, 184, 0.4);
}

.step-text {
    font-size: 14px;
    color: #B8C0C8;
    font-weight: 500;
    text-shadow: 0 0 10px rgba(53, 64, 80, 0.3);
}

.manual-footer {
    margin-top: 50px;
    text-align: center;
    position: relative;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(15, 22, 30, 0.6) 0%, rgba(26, 37, 48, 0.5) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid rgba(37, 48, 64, 0.3);
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(26, 37, 48, 0.3),
        inset 0 1px 0 rgba(64, 74, 85, 0.1);
}

.manual-footer-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(53, 64, 80, 0.3) 0%, transparent 70%);
    filter: blur(50px);
    animation: pulseGlow 4s ease-in-out infinite;
}

.manual-footer-text {
    font-size: 18px;
    font-weight: 600;
    color: #B8C0C8;
    text-shadow: 0 0 30px rgba(53, 64, 80, 0.6);
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #889098 0%, #B8C0C8 50%, #889098 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 반응형 디자인 - 사용설명서 */
@media (max-width: 768px) {
    .manual-section {
        margin-top: 60px;
        padding: 40px 20px;
    }

    .manual-icon {
        font-size: 48px;
        margin-bottom: 12px;
    }

    .manual-title {
        font-size: 28px;
        margin-bottom: 12px;
    }

    .manual-subtitle {
        font-size: 14px;
    }

    .manual-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .manual-card {
        padding: 24px;
    }

    .manual-card-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }

    .manual-card-title {
        font-size: 20px;
        margin-bottom: 10px;
    }

    .manual-card-description {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .step-item {
        padding: 10px;
        gap: 10px;
    }

    .step-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .step-text {
        font-size: 13px;
    }

    .manual-footer {
        margin-top: 40px;
        padding: 30px 20px;
    }

    .manual-footer-text {
        font-size: 16px;
    }
}
