* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    background-color: #f0f2f5;
    color: #333;
}

/* 헤더 스타일 */
.header {
    background-color: white;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    letter-spacing: -1px;
}

.nav-menu {
    display: flex;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #2980b9;
}

/* 메인 영역 스타일 */
.main-container {
    min-height: calc(100vh - 60px);
    /* 이미지와 유사한 보라/주황 그라데이션 원본 */
    background: linear-gradient(135deg, #2b184b 0%, #aa3625 50%, #d5531d 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card {
    background-color: #f7ede8;
    width: 100%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 16px;
    color: #7f8c8d;
    margin-bottom: 30px;
}

/* 추첨 번호 디스플레이 */
.numbers-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    min-height: 60px;
}

/* 공 모양 스타일 */
.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    box-shadow: 3px 3px 6px rgba(0,0,0,0.15), inset -2px -2px 6px rgba(0,0,0,0.1);
    /* 기본 애니메이션용 */
    transition: all 0.3s ease;
}

.ball-empty {
    background-color: #e0e0e0;
    color: #757575;
    text-shadow: none;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.1);
}

/* 공 색상 */
.ball-yellow { background: linear-gradient(135deg, #ffca28, #ff8f00); }
.ball-blue   { background: linear-gradient(135deg, #42a5f5, #1565c0); }
.ball-red    { background: linear-gradient(135deg, #ef5350, #c62828); }
.ball-gray   { background: linear-gradient(135deg, #78909c, #37474f); }
.ball-green  { background: linear-gradient(135deg, #66bb6a, #2e7d32); }

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

.ball.animated {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* 버튼 스타일 */
.generate-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    background: linear-gradient(135deg, #2980b9, #1f618d);
}

.generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.4);
}

/* 생성 기록 섹션 */
.history-section {
    width: 100%;
    margin-top: 10px;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
}

.delete-history-btn {
    background-color: #ff5252;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 15px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.delete-history-btn:hover {
    background-color: #d32f2f;
}

/* 기록 리스트 영역 */
.history-list {
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    height: 260px;
    overflow-y: auto;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
}

/* 스크롤바 커스텀 */
.history-list::-webkit-scrollbar {
    width: 6px;
}
.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb {
    background: #bdbdbd;
    border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb:hover {
    background: #9e9e9e;
}

/* 기록 한 줄 아이템 */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 5px;
    border-bottom: 1px dotted #eeeeee;
}
.history-item:last-child {
    border-bottom: none;
}

.history-balls {
    display: flex;
    gap: 5px;
}

/* 미니 공 스타일 (히스토리용) */
.mini-ball {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 700;
    color: white;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.history-time {
    font-size: 12px;
    color: #9e9e9e;
}

.empty-message {
    text-align: center;
    color: #9e9e9e;
    font-size: 14px;
    margin-top: 80px;
}

/* 모바일 대응 (반응형 다이내믹) */
@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        justify-content: center;
        padding: 8px 10px;
        gap: 8px;
    }
    .header {
        height: auto;
    }
    .logo {
        font-size: 20px;
    }
    .nav-menu {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .nav-menu a {
        font-size: 13px;
    }
    
    .card {
        padding: 30px 20px;
    }

    .ball {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .mini-ball {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
}

/* 광고 컨테이너 스타일 */
.ad-container {
    width: 100%;
    max-width: 728px;
    margin: 20px 0;
    text-align: center;
    min-height: 90px;
}

.ad-container-small {
    width: 100%;
    margin: 20px 0;
    text-align: center;
    min-height: 50px;
}
