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

:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --accent: #ffd700;
    --bg-dark: #0a0a1a;
    --bg-card: #12122a;
    --text-light: #ffffff;
    --text-muted: #a0a0b0;
    --border-color: #2a2a4a;
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 별 배경 */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 300px 200px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 350px 150px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 420px 250px, rgba(255,215,0,0.6), transparent),
        radial-gradient(1px 1px at 500px 100px, rgba(255,255,255,0.4), transparent);
    background-size: 550px 350px;
    animation: drift 60s linear infinite;
}

@keyframes drift {
    from { background-position: 0 0; }
    to { background-position: -550px -350px; }
}

/* 헤더 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* 메인 컨테이너 */
.main {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 100px 2rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 인트로 섹션 */
.intro {
    text-align: center;
    max-width: 600px;
    margin-bottom: 3rem;
}

.intro-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.intro h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-light);
}

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

.intro p {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.8;
}

/* 입력 카드 */
.input-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 480px;
    margin-bottom: 2rem;
}

.input-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    text-align: center;
}

.date-inputs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.date-input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
    text-align: center;
    transition: all 0.3s ease;
    font-family: inherit;
}

.date-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15);
}

.date-input::placeholder {
    color: var(--text-muted);
}

.calendar-type {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.3s ease;
}

.radio-label:hover {
    color: var(--text-light);
}

.radio-label input {
    accent-color: var(--accent);
    width: 18px;
    height: 18px;
}

.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent) 0%, #e6b800 100%);
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--bg-dark);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.35);
}

.submit-btn:active {
    transform: translateY(-1px);
}

/* 결과 카드 */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    width: 100%;
    max-width: 560px;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
}

.result-card.show {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* 서양 별자리 배너 */
.zodiac-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(255, 215, 0, 0.04) 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.zodiac-banner-icon {
    font-size: 2.2rem;
    line-height: 1;
}

.zodiac-banner-info {
    flex: 1;
}

.zodiac-banner-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.zodiac-banner-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* 결과 본문 */
.result-body {
    padding: 1.5rem;
}

/* 28수 타이틀 */
.su28-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

/* 28수 카드 그리드 */
.su28-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 230px);
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1.25rem;
}

/* 개별 28수 카드 */
.su28-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, transform 0.3s ease;
}

.su28-card:hover {
    border-color: rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.su28-card-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background: radial-gradient(ellipse at center, rgba(30, 40, 80, 0.6) 0%, transparent 70%);
    min-height: 140px;
}

.su28-card-img {
    width: 100%;
    max-width: 120px;
    height: auto;
    max-height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.su28-card-body {
    padding: 1rem 1.2rem 1.2rem;
}

.su28-card-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.15rem;
}

.su28-card-hanja {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 0.6rem;
}

.su28-card-direction {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.su28-card-meaning {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    line-height: 1.5;
}

/* 28수 안내 노트 */
.su28-note {
    grid-column: 1 / -1;
    text-align: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 215, 0, 0.06);
    border: 1px solid rgba(255, 215, 0, 0.15);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

/* 비교 노트 */
.comparison-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.6;
    opacity: 0.7;
    margin-bottom: 1.25rem;
}

/* 액션 버튼 */
.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    flex: 1;
    padding: 0.9rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.action-btn.primary {
    background: var(--accent);
    border: none;
    color: var(--bg-dark);
}

.action-btn.primary:hover {
    background: #fff;
    transform: translateY(-2px);
}

.action-btn.primary:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
}

.action-btn.secondary {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.action-btn.secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 다시하기 버튼 */
.retry-btn {
    margin-top: 1.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.retry-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 반응형 */
@media (max-width: 600px) {
    .header {
        padding: 1rem;
    }

    .header-title {
        font-size: 1rem;
    }

    .main {
        padding: 90px 1rem 2rem;
    }

    .intro h1 {
        font-size: 1.6rem;
    }

    .intro p {
        font-size: 0.95rem;
    }

    .input-card {
        padding: 1.5rem;
    }

    .date-inputs {
        flex-direction: column;
    }

    .calendar-type {
        gap: 1.5rem;
    }

    .result-body {
        padding: 1.2rem;
    }

    .su28-grid {
        grid-template-columns: 1fr;
    }

    .su28-card-img-wrap {
        padding: 1.2rem 1rem;
        min-height: 110px;
    }

    .su28-card-img {
        max-width: 100px;
        max-height: 100px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .zodiac-banner {
        padding: 1rem 1.2rem;
    }

    .zodiac-banner-icon {
        font-size: 1.8rem;
    }

    .zodiac-banner-name {
        font-size: 1.05rem;
    }

    .comparison-note {
        font-size: 0.72rem;
    }
}

@media (min-width: 601px) {
    .su28-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
