:root {
    --primary: #FFD700;
    --primary-dark: #FFA500;
    --dark: #1a1a1a;
    --danger: #FF3232;
    --success: #22c55e;
    --kakao: #FEE500;
    --shadow: rgba(0,0,0,0.1);
}

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

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.wrapper {
    max-width: 480px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.3);
}

header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 30px 20px;
    text-align: center;
    color: var(--dark);
    box-shadow: 0 4px 12px var(--shadow);
}

header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 5px;
}

header p {
    font-size: 0.9rem;
    opacity: 0.8;
}

.container {
    padding: 20px;
}

/* 카카오 로그인 섹션 */
.login-section {
    text-align: center;
    padding: 50px 20px;
}

.login-section h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.login-section p {
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-kakao {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kakao);
    padding: 18px 30px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    color: #3c1e1e;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-kakao:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.btn-kakao img {
    width: 24px;
    margin-right: 10px;
}

/* 사용자 환영 섹션 */
.welcome {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    border-radius: 15px;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px var(--shadow);
}

.welcome h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.stat-item {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-item strong {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 3px;
}

.stat-item span {
    font-size: 0.75rem;
    opacity: 0.9;
}

/* 번호 결과 섹션 */
.result-container {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    padding: 25px;
    border-radius: 20px;
    border: 3px solid var(--primary);
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(255, 215, 0, 0.3);
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
}

.result-header h4 {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.result-header .info {
    font-size: 0.85rem;
    color: #666;
}

.number-set {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.number-set:last-child {
    margin-bottom: 0;
}

.set-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #666;
    width: 50px;
}

.balls {
    display: flex;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.ball {
    width: 42px;
    height: 42px;
    line-height: 42px;
    background: var(--primary);
    border-radius: 50%;
    text-align: center;
    font-weight: bold;
    font-size: 1rem;
    color: var(--dark);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: transform 0.2s ease;
}

.ball:hover {
    transform: scale(1.1);
}

/* ✅ 로또 공 대역별 공식 색상 추가 (중요: 기존 .ball 색상을 덮어씁니다) */
.ball.b-1 { background: #fbc400; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* 1~10: 노랑 */
.ball.b-2 { background: #69c8f2; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* 11~20: 파랑 */
.ball.b-3 { background: #ff7272; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* 21~30: 빨강 */
.ball.b-4 { background: #aaaaaa; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* 31~40: 회색 */
.ball.b-5 { background: #b0d840; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.2); } /* 41~45: 초록 */

/* 버튼 스타일 */
.btn-primary {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, var(--dark) 0%, #333 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin-bottom: 15px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-youtube {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255,0,0,0.3);
    margin-bottom: 15px;
}

.btn-youtube:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,0,0,0.4);
}

.btn-share {
    width: 100%;
    padding: 15px;
    background: white;
    color: var(--dark);
    border: 2px solid #ddd;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share:hover {
    border-color: var(--primary);
    background: #fffbeb;
}

/* 로딩 화면 */
#loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.98);
    z-index: 999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    font-weight: bold;
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--dark);
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: #f3f3f3;
    border-radius: 10px;
    margin-top: 15px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 마일스톤 모달 */
.milestone-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.milestone-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    max-width: 350px;
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.milestone-emoji {
    font-size: 4rem;
    margin-bottom: 15px;
}

.milestone-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.milestone-content p {
    color: #666;
    margin-bottom: 20px;
}

/* CTA 강화 배너 */
.cta-banner {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(255,0,0,0.3);
}

.cta-banner strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.cta-banner small {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* 진수 정보 배지 */
.survivor-badge {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.survivor-badge strong {
    font-size: 1.2rem;
}

/* 푸터 */
footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 0.85rem;
}
