@import url('https://fonts.googleapis.com/css2?family=Pretendard:wght@400;700&display=swap');

/* [1] 기본 레이아웃 및 테마 */
.main-wrapper { max-width: 800px; margin: 0 auto; font-family: 'Pretendard', sans-serif; color: #ffffff; }
.gradient-text {
    background: linear-gradient(135deg, #a582ff 0%, #6dd5ed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}
.subtitle { color: #94a3b8; font-size: 0.9rem; }

/* [2] 카드 공통 디자인 */
.glass-card, .result-glass-card {
    background: rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 25px;
}

/* [3] 몽조 뱃지 (결과/히스토리 공용) */
.lucky-badge-wrapper {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 0.85rem;
    margin-bottom: 15px;
    letter-spacing: -0.5px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.badge-gold { background: linear-gradient(135deg, #fbc400 0%, #f6d365 100%); color: #4a3700 !important; }
.badge-purple { background: linear-gradient(135deg, #a582ff 0%, #6e45e2 100%); color: #ffffff !important; }
.badge-default { background: rgba(255, 255, 255, 0.15); color: #ffffff !important; backdrop-filter: blur(5px); }

/* [4] 오로라 로딩 효과 */
#loading-spinner { padding: 50px 0; }
.pulse-container {
    position: relative; width: 180px; height: 180px; margin: 0 auto;
    display: flex; align-items: center; justify-content: center;
}
.pulse-ring {
    position: absolute; width: 100%; height: 100%; border-radius: 50%;
    background: radial-gradient(circle, rgba(165,130,255,0.8) 0%, rgba(109,213,237,0.4) 50%, transparent 70%);
    animation: aurora-wave 2s infinite ease-out; filter: blur(10px);
}
.pulse-icon {
    position: relative; font-size: 90px; z-index: 2;
    filter: drop-shadow(0 0 15px rgba(165, 130, 255, 0.6));
    animation: crystal-float 2.5s infinite ease-in-out; user-select: none;
}
@keyframes aurora-wave {
    0% { transform: scale(0.6); opacity: 0.1; filter: hue-rotate(0deg); }
    50% { transform: scale(1.1); opacity: 0.5; filter: hue-rotate(90deg) blur(15px); }
    100% { transform: scale(1.4); opacity: 0; filter: hue-rotate(180deg); }
}
@keyframes crystal-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
.loading-text { color: #a582ff; font-weight: 700; font-size: 1.1rem; margin-top: 20px; text-shadow: 0 0 10px rgba(165, 130, 255, 0.4); }

/* [5] 입력 UI 및 버튼 */
.modern-input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important; border-radius: 15px; padding: 18px; resize: none;
}
.modern-input::placeholder { color: #64748b; }
.custom-label, .section-title { color: #a582ff; font-weight: 700; font-size: 0.95rem; margin-bottom: 12px; display: block; }
.char-counter { text-align: right; font-size: 0.8rem; color: #64748b; margin-top: 5px; }

.btn-glow-primary {
    background: linear-gradient(135deg, #6e45e2 0%, #88d3ce 100%);
    border: none; border-radius: 15px; color: white; font-weight: bold; padding: 18px; transition: 0.3s; width: 100%; font-size: 1.1rem;
}
.btn-glow-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(110, 69, 226, 0.3); }
.btn-history-toggle {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff; padding: 6px 14px; border-radius: 50px; font-size: 0.8rem; font-weight: 600; transition: all 0.3s ease;
}
.btn-retry {
    background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff; padding: 15px; border-radius: 15px; font-weight: 600; text-decoration: none; display: block; width: 100%; text-align: center; transition: 0.3s;
}

/* [6] 로또 볼 스타일 */
.ball-container { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.lotto-ball, .mini-ball {
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.4);
    box-shadow: inset -3px -3px 6px rgba(0,0,0,0.2), 2px 2px 5px rgba(0,0,0,0.2);
}
.lotto-ball { width: 45px; height: 45px; font-size: 1.2rem; }
.mini-ball { width: 28px; height: 28px; font-size: 0.75rem; margin: 2px; }
.ball-1 { background: #fbc400; } .ball-2 { background: #69c8f2; } .ball-3 { background: #ff7272; } .ball-4 { background: #aaa; } .ball-5 { background: #b0d840; }

/* [7] 리스트 및 AI 요약 토글 */
.list-item { background: rgba(255, 255, 255, 0.05); padding: 15px; border-radius: 12px; margin-bottom: 10px; border-left: 3px solid #a582ff; }
.ai-summary-box p { color: #ffffff !important; word-break: keep-all; line-height: 1.6; font-size: 0.95rem; margin: 0; }
.summary-truncate { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.btn-toggle-summary {
    background: none; border: none; color: #88d3ce; font-size: 0.75rem; font-weight: 700;
    padding: 8px 0 0 0; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
}

/* [8] 히스토리 모달 전용 */
.history-modal-content { background: #121212 !important; border: 1px solid rgba(255,255,255,0.1) !important; border-radius: 20px !important; color: #fff; }
.history-item-card { background: rgba(255, 255, 255, 0.05); border-radius: 16px; transition: background 0.3s; margin-bottom: 1.5rem; padding: 1rem; }
.user-dream-box { background: rgba(0, 0, 0, 0.3); border-radius: 10px; padding: 12px; margin-bottom: 1rem; }
.user-dream-box p { color: #e2e8f0 !important; font-style: italic; font-size: 0.9rem; margin: 0; }
#history-content { max-height: 70vh; overflow-y: auto; padding-right: 10px; }
#history-content::-webkit-scrollbar { width: 4px; }
#history-content::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }