@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@400;600;700&display=swap');

body {
    font-family: 'Noto Serif KR', serif;
    background: linear-gradient(135deg, #0f0524 0%, #1a103c 50%, #2d1b69 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #fff;
}
.hidden { display: none; }
.cosmic-title { text-shadow: 0 0 10px rgba(138, 109, 255, 0.7); letter-spacing: 2px; }
.cosmic-subtitle { text-shadow: 0 0 5px rgba(138, 109, 255, 0.5); letter-spacing: 1px; }

/* --- 통합 정보 입력 화면 --- */
.selection-section {
    margin-top: 2.5rem; /* 40px */
}
.section-title {
    font-size: 1.25rem; /* 20px */
    font-weight: 600;
    color: #e9d5ff;
    margin-bottom: 1rem; /* 16px */
}
.topic-btn.selected {
    background-color: #8a6dff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(138, 109, 255, 0.7);
}

/* --- 주제 선택 --- */
.topic-btn {
    background-color: rgba(138, 109, 255, 0.2);
    border: 1px solid #8a6dff;
    color: #e9d5ff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.topic-btn:hover {
    background-color: rgba(138, 109, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 0 15px rgba(138, 109, 255, 0.5);
}

/* --- 별 배경 --- */
.stars { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: -1; }
.star { position: absolute; background-color: #fff; border-radius: 50%; animation: twinkle 4s infinite; opacity: 0.7; }
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }
.constellation { position: absolute; width: 300px; height: 300px; opacity: 0.2; pointer-events: none; z-index: -1; }
.constellation.top-left { top: 50px; left: 50px; transform: rotate(15deg); }
.constellation.bottom-right { bottom: 50px; right: 50px; transform: rotate(-15deg); }
.constellation-dot { position: absolute; width: 3px; height: 3px; background-color: white; border-radius: 50%; }
.constellation-line { position: absolute; height: 1px; background-color: rgba(255, 255, 255, 0.3); transform-origin: left center; }

/* --- 카드 디자인 --- */
.card { width: 220px; height: 380px; perspective: 1000px; cursor: pointer; transition: transform 0.3s ease; background: none; }
.card:hover { transform: translateY(-10px); }
.card-inner { position: relative; width: 100%; height: 100%; transition: transform 0.8s; transform-style: preserve-3d; }
.flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: 15px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); }
.card-back { background: linear-gradient(135deg, #2b1055 0%, #4b2a97 100%); border: 2px solid #8a6dff; display: flex; align-items: center; justify-content: center; }
.card-front { transform: rotateY(180deg); background: linear-gradient(135deg, #2b1055 0%, #4b2a97 100%); border: 2px solid #8a6dff; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 20px; color: #fff; }
.card-pattern { width: 80%; height: 80%; background-image: radial-gradient(#8a6dff 2px, transparent 2px); background-size: 15px 15px; opacity: 0.3; border-radius: 10px; }
.card-icon { width: 100px; height: 100px; display: flex; align-items: center; justify-content: center; font-size: 5rem; line-height: 1; }
.card-title { font-weight: 700; font-size: 1.2rem; text-align: center; margin-bottom: 0.5rem; }
.card-meaning { font-size: 0.9rem; text-align: center; line-height: 1.4; }
.card-position-title { color: #d8b4fe; margin-top: 1rem; font-weight: 600; font-size: 1.1rem; }
.card-position-subtitle { color: #c084fc; font-size: 0.9rem; }

/* --- 하단 버튼 --- */
#action-buttons { margin-top: 6rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }
.btn {
    background-color: #8b5cf6;
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 9999px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}
.btn:hover {
    transform: scale(1.05);
    background-color: #7c3aed;
    box-shadow: 0 0 15px rgba(138, 109, 255, 0.7);
}

/* --- 해석 모달 --- */
.interpretation-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.8); display: none; align-items: center; justify-content: center; z-index: 1000; transition: opacity 0.3s ease; }
.interpretation-modal.active { display: flex; }
.modal-content { background: linear-gradient(135deg, #2b1055 0%, #4b2a97 100%); border-radius: 15px; padding: 30px; max-width: 800px; width: 90%; max-height: 80vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); border: 2px solid #8a6dff; position: relative; margin: 40px 0; }
.close-btn { position: absolute; top: 15px; right: 15px; background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
.interpretation-section { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.2); }
.interpretation-section:last-child { border-bottom: none; margin-bottom: 0; }
.loading-spinner { width: 50px; height: 50px; border: 5px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s ease-in-out infinite; margin: 50px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

#astrology-data-input {
    width: 100%;
    max-width: 42rem;   /* 주제 선택 영역과 동일한 너비로 변경! */
    display: block;     /* 가운데 정렬을 위해 추가 */
    margin-left: auto;  /* 가운데 정렬을 위해 추가 */
    margin-right: auto; /* 가운데 정렬을 위해 추가 */
    background-color: rgba(15, 5, 36, 0.7);
    border: 1px solid #8a6dff;
    color: #e9d5ff;
    padding: 15px;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.copy-button-container {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}