body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f0f4f8;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.main-wrapper.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 40px 0;
}

.main-content {
    background: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    max-width: 700px;
    width: 90%;
    text-align: center;
}

h1 { margin-bottom: 0.5rem; color: #2c3e50; }
.subtitle { color: #7f8c8d; margin-bottom: 2.5rem; }

.ball-container { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; margin-bottom: 2.5rem; }
.ball {
    width: 50px; height: 50px; border-radius: 50%; display: flex;
    justify-content: center; align-items: center; color: white;
    font-weight: bold; font-size: 1.1rem; box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.ball.mini { width: 30px; height: 30px; font-size: 0.8rem; }

/* 색상 공통 클래스 */
.yellow { background-color: #fbc02d !important; }
.blue { background-color: #1e88e5 !important; }
.red { background-color: #e53935 !important; }
.gray { background-color: #757575 !important; }
.green { background-color: #43a047 !important; }

#generate-btn {
    padding: 1rem 3.5rem; font-size: 1.2rem; font-weight: bold; color: white;
    background: #3498db; border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* 실시간 분석 버튼 스타일 */
.realtime-analysis-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f1f1;
}

.realtime-analysis-section h3 { font-size: 0.9rem; color: #7f8c8d; margin-bottom: 1.5rem; }

.analysis-grid-horizontal {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.analysis-item-link { text-decoration: none; display: block; }

.analysis-item.clickable {
    background: #f8f9fa;
    padding: 12px 5px;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: all 0.2s;
    cursor: pointer;
}

.analysis-item.clickable:hover {
    background: #eef2f7;
    border-color: #3498db;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.label { display: block; font-size: 0.75rem; color: #7f8c8d; margin-bottom: 5px; }
.value { font-size: 1rem; font-weight: bold; color: #2c3e50; }

/* 상단 플로팅 네비게이션 버튼 */
.nav-links {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 3000;
}

.nav-btn.small {
    background: white;
    color: #3498db;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    border: 2px solid #3498db;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.small:hover {
    background: #3498db;
    color: white;
    transform: translateX(5px);
    box-shadow: 0 6px 15px rgba(52, 152, 219, 0.3);
}

/* 하단 네비게이션 유지 (페이지 맨 끝 버튼) */
.footer-nav {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 2px solid #f1f1f1;
    text-align: center;
}

.nav-btn.large {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: #27ae60;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
    transition: all 0.2s;
}

.nav-btn.large:hover {
    background: #2ecc71;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(39, 174, 96, 0.4);
}

/* 분석 페이지 스타일 보강 */
.analysis-page {
    display: block;
    padding: 40px 0;
}

.my-numbers-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    background: #edf2f7;
    padding: 15px 25px;
    border-radius: 50px;
    margin: 20px auto 40px;
    max-width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.banner-label {
    font-weight: bold;
    color: #4a5568;
    font-size: 0.9rem;
}

.my-numbers-banner .ball-container.mini {
    margin-bottom: 0;
    gap: 8px;
}

.analysis-page .container.wide {
    margin: 20px auto;
    padding: 60px 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 1100px;
}

.analysis-card { background: #fcfcfc; border: 1px solid #eee; padding: 1.5rem; border-radius: 15px; margin-bottom: 2rem; }

/* 빈도 차트 스타일 (1~45번) */
.frequency-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 280px; /* 높이를 더 키워 여유 공간 확보 */
    margin-top: 2rem;
    padding-top: 20px; /* 상단 여백 추가 */
    padding-bottom: 40px;
    border-bottom: 2px solid #eee;
    overflow-x: auto;
}

.bar-wrapper {
    flex: 0 0 22px;
    min-width: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end; /* 아래쪽으로 정렬 */
    height: 100%;
    position: relative;
}

.bar-value {
    font-size: 0.65rem;
    color: #2c3e50;
    font-weight: bold;
    margin-bottom: 5px;
    z-index: 5;
}

.bar {
    width: 100%;
    border-radius: 3px 3px 0 0;
    transition: all 0.2s;
    cursor: default;
    min-height: 2px;
}

.bar:hover {
    filter: brightness(1.1);
}

.bar-label {
    position: absolute;
    bottom: -25px;
    font-size: 0.7rem;
    color: #95a5a6;
    font-weight: bold;
}

/* 분포 차트 스타일 보완 */
.dist-bar-chart { 
    display: flex; 
    align-items: flex-end; 
    gap: 15px; 
    height: 200px; /* 높이 상향 */
    margin-top: 1rem; 
    padding-top: 30px; /* 상단 숫자 공간 확보 */
    border-bottom: 2px solid #eee; 
    padding-bottom: 35px;
    overflow-x: auto;
}

.dist-bar { 
    flex: 0 0 auto; 
    background: #3498db; 
    border-radius: 4px 4px 0 0; 
    position: relative; 
    min-width: 45px;
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dist-value { 
    position: absolute; 
    top: -25px; /* 막대 바로 위에 위치 */
    left: 50%; 
    transform: translateX(-50%); 
    font-size: 0.8rem; 
    font-weight: bold; 
    color: #2c3e50; 
}

.dist-label { 
    position: absolute; 
    bottom: -30px; 
    left: 50%; 
    transform: translateX(-50%); 
    font-size: 0.75rem; 
    color: #7f8c8d; 
    font-weight: bold;
}

@media (max-width: 768px) {
    .analysis-page .container.wide {
        padding: 40px 15px;
    }
}