/* ==========================================
   1. 웹 폰트 임포트 및 기본 초기화 (Reset)
   ========================================== */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    overflow-x: hidden; /* 모바일 가로 스크롤(해킹/깨짐) 방지 */
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background-color: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
    letter-spacing: -0.02em;
    word-break: keep-all; /* 한글 단어 단위 줄바꿈 */
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

button, input, select {
    font-family: inherit;
}

/* 공통 컨테이너 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================
   2. 헤더 & 네비게이션 (Header & Nav)
   ========================================== */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-nav {
    background-color: #111111;
    color: #ffffff;
    padding: 8px 0;
    text-align: center;
}

.top-nav-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
    display: inline-block;
}

.main-nav {
    padding: 12px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-width: 280px;
    width: 100%;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.main-menu {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-menu li {
    display: inline-block;
    white-space: nowrap;
}

.main-menu a {
    font-size: 15px;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 6px 0;
}

.main-menu a:hover {
    color: #2563eb;
}

/* ==========================================
   3. 히어로 섹션 (Hero Section)
   ========================================== */
.hero-section {
    position: relative; 
    background-image: linear-gradient(to bottom, rgba(15, 15, 15, 0.85), rgba(20, 20, 20, 0.95)), url('images/lotto-bg.png'); 
    background-size: cover; 
    background-position: center; 
    padding: 75px 0; 
    text-align: center; 
    color: #ffffff;
}

.hero-title {
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.25;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

.hero-subtitle {
    margin-top: 16px;
    font-size: clamp(14px, 2.5vw, 18px);
    line-height: 1.6;
    opacity: 0.95;
}

/* ==========================================
   4. 대시보드 & 카드 레이아웃 (Dashboard Grid)
   ========================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 30px;
}

.card-box {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #ffffff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid #e2e8f0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 8px;
}

.card-header h3 {
    margin: 0;
    font-size: clamp(18px, 3vw, 22px);
    font-weight: 900;
    color: #111111;
}

/* ==========================================
   5. 로또 당첨 번호 공 (Ball) 스타일
   ========================================== */
.balls-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
    flex-wrap: nowrap;
}

.ball {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 16px;
    color: #ffffff;
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.3), 0 3px 6px rgba(0,0,0,0.15);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.ball:hover { 
    transform: scale(1.08); 
}

.ball.placeholder { 
    background: #f1f5f9; 
    color: #64748b; 
    border: 2px dashed #cbd5e1; 
    box-shadow: none; 
    font-weight: 700; 
}

/* 로또 번호대별 공식 색상 */
.ball.num-1-10  { background: radial-gradient(circle at 14px 14px, #fde047, #ca8a04); color: #111111; }
.ball.num-11-20 { background: radial-gradient(circle at 14px 14px, #38bdf8, #0284c7); }
.ball.num-21-30 { background: radial-gradient(circle at 14px 14px, #f87171, #dc2626); }
.ball.num-31-40 { background: radial-gradient(circle at 14px 14px, #9ca3af, #4b5563); }
.ball.num-41-45 { background: radial-gradient(circle at 14px 14px, #4ade80, #16a34a); }

/* ==========================================
   6. 대시보드 폼 & 버튼 컴포넌트
   ========================================== */
.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-submit:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.preset-btn-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.preset-btn {
    padding: 10px 8px;
    font-size: 13px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.preset-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* ==========================================
   7. 꿈 해몽 모듈 컴포넌트
   ========================================== */
.dream-search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.dream-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-weight: 700;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
}

.dream-input:focus {
    border-color: #2563eb;
}

.dream-tag {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dream-tag:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

/* ==========================================
   8. 푸터 (Footer) - 하단 흰색 벌어짐 현상 차단
   ========================================== */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    padding: 36px 0;
    font-size: 13px;
    border-top: 1px solid #1e293b;
    margin-top: 0 !important; /* 바깥 여백 0 처리로 하단 흰색 비침 현상 근본 차단 */
}

.footer-container {
    text-align: center;
    line-height: 1.6;
}

.footer-container .copyright {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-container .disclaimer {
    font-size: 12px;
    color: #64748b;
}

/* ==========================================
   📱 9. 반응형 미디어 쿼리 (Responsive Rules)
   ========================================== */

/* 💻 태블릿 구간 (1024px 이하) */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* 📱 모바일 스마트폰 구간 (768px 이하) */
@media (max-width: 768px) {
    .top-nav-text {
        font-size: 11px;
        padding: 0 10px;
        line-height: 1.4;
    }

    .nav-container {
        flex-direction: column;
        gap: 12px;
    }

    .logo {
        max-width: 240px;
    }

    .main-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px 16px;
    }

    .main-menu a {
        font-size: 14px;
    }

    .hero-section {
        padding: 45px 0;
    }

    .card-box {
        padding: 18px;
    }

    .balls-container {
        gap: 6px;
    }

    .ball {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .preset-btn-group {
        grid-template-columns: repeat(2, 1fr);
    }

    .dream-search-box {
        flex-direction: column;
    }

    .dream-search-box button {
        width: 100%;
        padding: 14px;
    }

    .site-footer {
        padding: 24px 0;
        margin-top: 0 !important;
    }
}

/* 📱 초소형 스마트폰 구간 (380px 이하) */
@media (max-width: 380px) {
    .balls-container {
        gap: 4px;
    }

    .ball {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .card-box {
        padding: 14px;
    }
}

/* 기존 style.css 맨 아래에 이어서 붙여넣으세요 */

/* ==========================================
   10. 수익형 광고 배너 레이아웃 (CLS 방지 전용)
   ========================================== */
.ad-banner-slot {
    width: 100%;
    max-width: 1200px;
    margin: 28px auto;
    min-height: 100px;
    background-color: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
    padding: 10px;
    text-align: center;
}

@media (max-width: 768px) {
    .ad-banner-slot {
        margin: 20px auto;
        min-height: 250px; /* 모바일 반응형 광고 최소 높이 확보 */
    }
}