:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --container-bg: #ffffff;
    --number-bg: #ffffff;
    --number-border: #dee2e6;
    --btn-bg: #007bff;
    --btn-text: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #1a1c1e;
    --footer-text: #ffffff;
    --accent-color: #6e8efb;
}

[data-theme="dark"] {
    --bg-color: #0f1113;
    --text-color: #f1f3f5;
    --container-bg: #1e2124;
    --number-bg: #2b3035;
    --number-border: #3d4146;
    --btn-bg: #339af0;
    --btn-text: #ffffff;
    --nav-bg: rgba(30, 33, 36, 0.95);
    --footer-bg: #000000;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.3s, color 0.3s;
}

/* Header & Navbar */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0.8rem 2rem;
}

.logo a {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 1.8rem;
}

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

.nav-links a:hover {
    color: var(--btn-bg);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-select {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--number-border);
    background: var(--number-bg);
    color: var(--text-color);
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
}

.theme-toggle {
    margin-left: 0.5rem;
}

#theme-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--number-border);
    background: var(--number-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.85rem;
}

/* Hero Section */
.hero {
    height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
    color: white;
    padding: 100px 20px 20px;
}

.hero h1 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Container & Sections */
.container {
    max-width: 800px;
    margin: 60px auto;
    padding: 3.5rem 2.5rem;
    background-color: var(--container-bg);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.04);
}

.section-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(110, 142, 251, 0.1);
    color: var(--accent-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: -0.5px;
}

.section-desc {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

[data-theme="dark"] .section-desc {
    color: #adb5bd;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: var(--btn-bg);
}

/* Upload Box */
.upload-box {
    border: 2px dashed var(--number-border);
    border-radius: 16px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-color);
}

.upload-box:hover {
    border-color: var(--btn-bg);
    background: rgba(110, 142, 251, 0.05);
}

/* Lotto Numbers */
.lotto-numbers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 2.5rem 0;
}

.number {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--number-bg);
    border: 3px solid var(--number-border);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 800;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(110, 142, 251, 0.1);
    border-top: 4px solid var(--btn-bg);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

/* Buttons */
.main-btn {
    display: inline-block;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background-color: var(--btn-bg);
    color: var(--btn-text);
    transition: all 0.2s;
}

.main-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

/* Back to Top */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--btn-bg);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    font-size: 1.5rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 4rem 1rem;
    text-align: center;
}

footer a {
    color: #868e96;
    text-decoration: none;
    margin: 0 12px;
    font-size: 0.9rem;
    transition: color 0.2s;
}

footer a:hover {
    color: white;
}

@media (max-width: 768px) {
    .navbar { padding: 0.8rem 1rem; flex-direction: column; gap: 1rem; }
    .nav-links { display: none; }
    .hero h1 { font-size: 2.2rem; }
    .container { padding: 2rem 1.5rem; }
    .number { width: 50px; height: 50px; font-size: 1.3rem; }
}