:root {
    --bg-color: #f8f9fa;
    --text-color: #333;
    --input-bg: #fff;
    --input-text: #000;
    --ball-gray: #aaa;
    --picker-ball-bg: #ddd;
    --header-color: #2c3e50;
    --accent-color: #3498db;
    --card-bg: #ffffff;
    --border-color: #eee;
}

[data-theme='dark'] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --input-bg: #1e1e1e;
    --input-text: #fff;
    --ball-gray: #555;
    --picker-ball-bg: #333;
    --header-color: #ecf0f1;
    --accent-color: #2980b9;
    --card-bg: #1e1e1e;
    --border-color: #333;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.top-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    color: var(--header-color);
    margin-bottom: 10px;
}

#subtitle {
    color: var(--accent-color);
    font-weight: 500;
}

.generator-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 40px;
    text-align: center;
}

.input-group {
    margin-bottom: 30px;
}

select, input {
    padding: 10px;
    font-size: 15px;
    background-color: var(--input-bg);
    color: var(--input-text);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

button {
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.1s, opacity 0.2s;
}

button:active { transform: scale(0.98); }

.draw { background: #4CAF50; color: white; }
.reset { background: #e74c3c; color: white; }
.theme-toggle { background: var(--accent-color); color: white; }

.info-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.info-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.info-card h2 {
    font-size: 1.2rem;
    margin-top: 0;
    color: var(--accent-color);
}

#results { margin-top: 30px; }

.line {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.gameLabel { font-weight: bold; width: 90px; }

/* 로또 공 */
.ball {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-weight: bold;
    color: white;
    animation: spin 0.6s linear infinite;
}

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

.yellow { background: #fbc400; }
.blue { background: #69c8f2; }
.red { background: #ff7272; }
.gray { background: var(--ball-gray); }
.green { background: #7bc043; }

#picker { max-width: 650px; margin: 20px auto; }

.pickBall {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    margin: 4px;
    border-radius: 50%;
    background: var(--picker-ball-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

/* 선택된 번호 스타일 (우선순위 확보 및 가독성 개선) */
.pickBall.yellow { background: #fbc400; color: white; box-shadow: 0 0 8px rgba(251, 196, 0, 0.6); }
.pickBall.blue { background: #69c8f2; color: white; box-shadow: 0 0 8px rgba(105, 200, 242, 0.6); }
.pickBall.red { background: #ff7272; color: white; box-shadow: 0 0 8px rgba(255, 114, 114, 0.6); }
.pickBall.gray { background: #aaa; color: white; box-shadow: 0 0 8px rgba(170, 170, 170, 0.6); }
.pickBall.green { background: #7bc043; color: white; box-shadow: 0 0 8px rgba(123, 192, 67, 0.6); }

.contact-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: var(--card-bg);
    border-radius: 15px;
    border: 1px solid var(--border-color);
}

.contact-form form { display: flex; flex-direction: column; gap: 15px; }

.contact-form input, .contact-form textarea {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--input-bg);
    color: var(--input-text);
}

.site-footer {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.footer-links a {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    color: var(--text-color);
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

@media (max-width: 600px) {
    .info-section { grid-template-columns: 1fr; }
    .ball { width: 40px; height: 40px; font-size: 14px; }
}
