:root {
    --primary-color: #0066cc; /* 밝고 전문적인 느낌의 블루 */
    --primary-hover: #0052a3;
    --highlight: #007bff;
    --text-main: #2d3748; /* 부드러운 다크 그레이로 가독성 확보 */
    --text-muted: #718096;
    --bg-main: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --ball-color: #ffffff;
    --ball-border: #cbd5e0;
    --ball-text: #4a5568;
    --bonus-ball-bg: #fbd38d; /* 부드러운 옐로우/오렌지 포인트 */
    --bonus-ball-border: #f6ad55;
    --bonus-ball-text: #744210;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.nav {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.nav a:hover {
    color: var(--primary-color);
}

/* Buttons */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 102, 204, 0.2);
}

/* 네비게이션 버튼 박스 스타일 */
.nav-btn {
    display: inline-block;
    padding: 8px 18px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-main);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    text-decoration: none;
    margin: 0 4px;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: var(--text-main);
    border-color: rgba(0, 0, 0, 0.15);
}

.nav-btn.primary {
    background: var(--primary-color);
    color: #ffffff;
    border: 1px solid var(--primary-color);
}

.nav-btn.primary:hover {
    background: #0052a3;
    border-color: #0052a3;
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
}

.btn-primary.large {
    padding: 16px 40px;
    font-size: 1.1rem;
    border-radius: 12px;
}

.btn-primary-outline {
    display: inline-block;
    background-color: transparent;
    color: var(--primary-color);
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    border: 1.5px solid var(--primary-color);
    transition: all 0.2s ease;
}

.btn-primary-outline:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Hero Section */
.hero {
    padding: 120px 0 100px;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-main) 100%);
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    color: var(--text-main);
    word-break: keep-all;
}

.highlight {
    color: var(--primary-color);
}

.hero-text p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 480px;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

/* Background decoration for hero visual */
.hero-visual::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0,102,204,0.1) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
    z-index: 0;
}

/* Lotto Balls */
.lotto-balls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
}

.ball {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--ball-color);
    border: 2px solid var(--ball-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ball-text);
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.ball:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.ball.plus {
    background-color: transparent;
    border: none;
    box-shadow: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    width: 30px;
}

.ball.bonus {
    background-color: var(--bonus-ball-bg);
    border-color: var(--bonus-ball-border);
    color: var(--bonus-ball-text);
}

/* Features */
.features {
    padding: 100px 0;
    background-color: var(--bg-main);
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-desc {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 60px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.feature-card {
    padding: 48px 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #fff;
}

.feature-card:nth-child(1) { background: linear-gradient(135deg, #4776E6, #8E54E9); }
.feature-card:nth-child(2) { background: linear-gradient(135deg, #FF512F, #DD2476); }
.feature-card:nth-child(3) { background: linear-gradient(135deg, #1A2980, #26D0CE); }

.color-red { background: linear-gradient(135deg, #e84118, #c23616); }
.color-gray { background: linear-gradient(135deg, #718093, #2f3640); }
.color-green { background: linear-gradient(135deg, #4cd137, #44bd32); }

.ball-mini {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.feature-card .icon {
    font-size: 3.2rem;
    margin-bottom: 24px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.feature-card h4 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    font-weight: 700;
    color: #fff;
}

.feature-card p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Generate Section */
.generate-section {
    padding: 100px 0;
    background-color: var(--bg-secondary);
}

.text-center {
    text-align: center;
}

.action-box {
    background-color: var(--bg-card);
    padding: 64px 40px;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    max-width: 700px;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.result-container {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.result-container p {
    margin-bottom: 24px;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.hidden {
    display: none;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes rollIn {
    0% { opacity: 0; transform: translateX(-40px) rotate(-180deg) scale(0.5); }
    100% { opacity: 1; transform: translateX(0) rotate(0) scale(1); }
}

.ball.rolling {
    animation: rollIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* --- Community Preview --- */
.community-preview {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.community-preview li {
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.5);
    padding: 12px 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
    cursor: pointer;
}

.community-preview li:hover {
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.community-preview .post-title {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.community-preview .post-author {
    color: var(--text-muted);
    font-size: 0.85rem;
}

@media (max-width: 600px) { transition-delay: 0.15s; }
.delay-2 { transition-delay: 0.3s; }

/* --- Footer Links --- */
.footer-links {
    margin-bottom: 12px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}
.footer-links a:hover {
    color: var(--primary-color);
}
.footer-links .divider {
    margin: 0 10px;
    color: var(--border-color);
}

/* --- Internal Pages (About, Terms, Privacy) --- */
.page-header {
    background-color: var(--bg-secondary);
    padding: 50px 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    max-width: 1000px;
    margin: 40px auto;
    box-shadow: var(--shadow-sm);
}
.page-header h2 {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 10px;
}
.page-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}
.page-content {
    padding: 60px 0;
    max-width: 800px;
    margin: 0 auto;
}
.document-text h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
    color: var(--text-main);
}
.document-text p, .document-text li {
    margin-bottom: 15px;
    color: var(--text-muted);
    line-height: 1.8;
}
.document-text ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

/* --- Article Listing & Detailed Post --- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}
.article-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--bg-secondary);
    color: var(--primary-color);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}
.article-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}
.article-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.article-meta {
    font-size: 0.85rem;
    color: #a0aec0;
}
.article-body {
    font-size: 1.1rem;
    line-height: 1.9;
}
.article-body h3 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
}
.article-body p {
    margin-bottom: 20px;
}

/* --- Community Board --- */
.board-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-sm);
}
.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.board-list {
    width: 100%;
    border-collapse: collapse;
}
.board-list th, .board-list td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}
.board-list th {
    font-weight: 600;
    color: var(--text-muted);
    background-color: var(--bg-secondary);
}
.board-list tr:hover td {
    background-color: var(--bg-secondary);
}
.board-list .title-col {
    width: 60%;
}
.board-list a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
}
.board-list a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.write-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.write-form input, .write-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}
.write-form textarea {
    resize: vertical;
    min-height: 150px;
}
.write-form input:focus, .write-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* --- Auth Forms --- */
.auth-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
}
.auth-form .form-group {
    margin-bottom: 20px;
}
.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-main);
}
.auth-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}
.auth-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,102,204,0.1);
}

/* --- Lotto Official Colors --- */
.ball.color-yellow { background-color: #fbc400; color: #fff; border-color: #fbc400; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball.color-blue { background-color: #69c8f2; color: #fff; border-color: #69c8f2; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball.color-red { background-color: #ff7272; color: #fff; border-color: #ff7272; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball.color-gray { background-color: #aaaaaa; color: #fff; border-color: #aaaaaa; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.ball.color-green { background-color: #b0d840; color: #fff; border-color: #b0d840; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

.game-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.game-label {
    display: flex;
    align-items: center;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.1rem;
    width: 80px;
    justify-content: flex-end;
    margin-right: 15px;
}

/* --- AI Terminal --- */
.ai-terminal {
    background: #1e1e1e;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin: 20px auto;
    max-width: 600px;
    overflow: hidden;
    font-family: 'Courier New', Courier, monospace;
}
.terminal-header {
    background: #333;
    padding: 10px;
    display: flex;
    align-items: center;
}
.terminal-header .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }
.terminal-title {
    color: #ccc;
    font-size: 0.9rem;
    margin-left: 10px;
}
.terminal-log {
    padding: 20px;
    height: 200px;
    overflow-y: auto;
    color: #0f0;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: left;
}
.terminal-line {
    margin-bottom: 5px;
    opacity: 0;
    animation: fadeInLog 0.2s forwards;
}
@keyframes fadeInLog {
    to { opacity: 1; }
}

/* --- Hot/Cold Container --- */
.hero-hc-container {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    animation: fadeInUp 0.5s ease forwards;
}

/* --- Tabs --- */
.tabs-container {
    display: flex;
    justify-content: center;
    max-width: 700px;
    margin: 0 auto;
}
.tab-btn {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    border-bottom: none;
    background: #f1f5f9;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}
.tab-btn:first-child {
    border-top-left-radius: 16px;
}
.tab-btn:last-child {
    border-top-right-radius: 16px;
}
.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary-color);
    border-top: 3px solid var(--primary-color);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.02);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* --- Personalize Box (Saju/Ohang) --- */
.personalize-box {
    margin-bottom: 30px;
    background: #f8fafc;
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
    box-shadow: var(--shadow-sm);
}
.personalize-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary-color);
    font-size: 1.05rem;
}
.input-date {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-main);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.input-date:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.15);
}
.personalize-box .hint {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0;
    line-height: 1.4;
}

.hot-cold-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    font-size: 0.95rem;
}
.hc-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.hc-label {
    font-weight: 700;
    color: var(--text-main);
}
.badge-hot {
    background-color: #ffe5e5;
    color: #e53e3e;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}
.badge-cold {
    background-color: #eebffd;
    color: #6b46c1;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* --- Google AdSense Placeholders --- */
.adsense-container {
    width: 100%;
    margin: 30px 0;
    text-align: center;
    display: none !important; /* 승인 전 숨김 처리 */
}
.adsense-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background-color: #f8fafc;
    border: 2px dashed #cbd5e0;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s;
}
.adsense-placeholder:hover {
    background-color: #f1f5f9;
}
.adsense-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    height: 600px;
    z-index: 50;
    display: none !important; /* 승인 전 숨김 처리 */
    flex-direction: column;
    gap: 10px;
}
/* 컨테이너(1200px)의 절반인 600px에서 20px 띄운 위치에 고정 */
.adsense-sidebar.left { 
    left: auto; 
    right: 50%; 
    margin-right: 620px; 
}
.adsense-sidebar.right { 
    right: auto; 
    left: 50%; 
    margin-left: 620px; 
}

.adsense-placeholder.vertical {
    width: 100%;
    flex: 1; /* 상하 공간 절반 차지 */
    max-width: none;
}

.custom-ad-container {
    width: 100%;
    flex: 1; /* 상하 공간 절반 차지 */
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.custom-ad-container.filled {
    border: none;
    background: transparent;
}

/* Responsive */
@media (max-width: 1560px) {
    .adsense-sidebar {
        /* 화면이 줄어들면 다시 화면 양끝에 붙도록 수정 */
        right: auto !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    .adsense-sidebar.left { left: 15px !important; }
    .adsense-sidebar.right { right: 15px !important; left: auto !important; }
}

@media (max-width: 1350px) {
    .adsense-sidebar {
        display: none; /* 원래 설정대로 복구 */
    }
}

/* --- Modal --- */
.modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; justify-content: center; align-items: center;
    backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.modal-content {
    background: var(--bg-card); width: 90%; max-width: 800px;
    border-radius: 12px; padding: 40px; position: relative;
    max-height: 85vh; overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}
.close-modal {
    position: absolute; top: 20px; right: 25px; font-size: 2rem;
    cursor: pointer; color: var(--text-muted);
    transition: color 0.2s;
}
.close-modal:hover { color: var(--text-main); }
.modal-meta {
    font-size: 0.95rem; color: var(--text-muted); margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color); padding-bottom: 15px;
}
.modal-body {
    line-height: 1.8; color: var(--text-main); font-size: 1.05rem;
}
.modal-body h3 { margin-top: 30px; margin-bottom: 15px; color: var(--primary-color); font-size: 1.4rem; }
.modal-body ul { margin-left: 20px; margin-bottom: 20px; }

@media (max-width: 800px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 40px;
    }
    
    .hero-text h2 {
        font-size: 2.2rem;
    }

    .hero-text p {
        margin: 0 auto 32px;
    }

    .hero-visual {
        justify-content: center;
        width: 100%;
    }

    .nav {
        display: none; /* 모바일 메뉴 간소화 */
    }

    .action-box {
        padding: 40px 24px;
    }
}

/* 데스크탑에서도 메인 히어로 섹션 구슬이 너무 크지 않도록 적당히 조절 */
#mainHeroBallsContainer .ball {
    width: 46px;
    height: 46px;
    font-size: 1rem;
}

/* 모바일 화면에서 로또 구슬이 한 줄에 나오도록 크기 및 간격 축소 */
@media (max-width: 600px) {
    .hero-text h2 {
        font-size: clamp(1.4rem, 6.5vw, 2.2rem) !important;
        word-break: keep-all;
    }
    .ball {
        width: 38px !important;
        height: 38px !important;
        font-size: 0.9rem !important;
        border-width: 1px !important;
    }
    .lotto-balls {
        gap: 6px !important;
    }
    /* 플러스 기호 크기도 맞춤 조절 */
    #mainHeroBallsContainer > div[style*="font-size"] {
        font-size: 1.1rem !important;
        margin: 0 2px !important;
    }
}

/* --- 5가지 프리미엄 UI 기능 (다크모드, 히트맵, 카운트다운 등) --- */

/* 1. 다크 모드 (Dark Mode) 변수 재정의 */
body.dark-mode {
    --bg-main: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --ball-color: #334155;
    --ball-border: #475569;
    --ball-text: #f8fafc;
}
body.dark-mode .community-preview { background: rgba(30, 41, 59, 0.85); border-color: rgba(51, 65, 85, 0.8); }
body.dark-mode .community-preview li { background: rgba(15, 23, 42, 0.9); border-color: rgba(51, 65, 85, 0.5); }
body.dark-mode .community-preview li:hover { background: #334155; }
body.dark-mode .terminal { background: #000; border-color: #333; }
body.dark-mode .feature-card { background: var(--bg-card); box-shadow: 0 4px 6px rgba(0,0,0,0.3); }

/* 다크모드 헤더 및 네비게이션 버튼 수정 */
body.dark-mode .header { background: rgba(15, 23, 42, 0.95); border-bottom-color: var(--border-color); }
body.dark-mode .nav-btn { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.1); color: var(--text-main); }
body.dark-mode .nav-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.2); }

/* 다크모드 토글 버튼 */
.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 15px;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.2s;
}
.theme-toggle-btn:hover { background: var(--border-color); }

/* 2. 카운트다운 타이머 UI */
.countdown-container {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.countdown-time { font-family: monospace; font-size: 1.3rem; letter-spacing: 2px; font-weight: 700; background: rgba(0,0,0,0.2); padding: 4px 10px; border-radius: 6px; margin-left: 10px; }

/* 3. 데이터 시각화 차트 및 히트맵 래퍼 */
.analysis-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
    justify-content: center;
}
.chart-container {
    flex: 1 1 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

/* 4. 히트맵 (Heatmap) 그리드 */
.heatmap-container {
    flex: 1 1 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 8px;
    margin-top: 20px;
}
.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    color: rgba(255,255,255,0.9);
    transition: transform 0.2s;
}
.heatmap-cell:hover { transform: scale(1.1); z-index: 2; box-shadow: 0 2px 5px rgba(0,0,0,0.3); }

/* 히트맵 온도(색상) 범례 */
.heatmap-legend { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }
.legend-gradient { height: 8px; flex-grow: 1; margin: 0 10px; border-radius: 4px; background: linear-gradient(to right, #3b82f6, #94a3b8, #ef4444); }

/* 5. AI 진행률 프로그레스 바 */
.terminal-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 15px;
    overflow: hidden;
    position: relative;
    display: none;
}
.terminal-progress-bar {
    height: 100%;
    width: 0%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    transition: width 0.3s ease;
}

/* 6. 실시간 롤링 배너 (Ticker) */
.ticker-container {
    width: 100%;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    text-align: center;
    overflow: hidden;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
    z-index: 10;
}
.dark-mode .ticker-container {
    background: #1e293b;
}
.ticker-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    display: inline-block;
    transition: transform 0.5s ease, opacity 0.5s ease;
}
