:root {
    --primary-color: #4a90e2;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-color: #333;
    --sub-text-color: #666;
    --ball-size: 60px;
    
    /* Lotto Ball Colors */
    --color-yellow: #fbc02d;
    --color-blue: #1976d2;
    --color-red: #e53935;
    --color-gray: #757575;
    --color-green: #43a047;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #ffffff;
    --sub-text-color: #b0b0b0;
    --primary-color: #90caf9;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.container {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    width: 90%;
    max-width: 500px;
    position: relative;
    transition: background-color 0.4s ease, transform 0.3s ease;
}

.theme-toggle {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background-color: rgba(0,0,0,0.05);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s, transform 0.2s;
}

[data-theme="dark"] .theme-toggle {
    background-color: rgba(255,255,255,0.1);
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

header h1 {
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

header p {
    color: var(--sub-text-color);
    margin-bottom: 2rem;
}

.ball-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    min-height: 100px;
    margin-bottom: 2rem;
    align-items: center;
}

.placeholder-text {
    color: #aaa;
    font-style: italic;
}

.lotto-ball {
    width: var(--ball-size);
    height: var(--ball-size);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.2), 0 5px 15px rgba(0,0,0,0.1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* Ball Color Classes */
.ball-yellow { background: radial-gradient(circle at 30% 30%, #fff263, var(--color-yellow)); }
.ball-blue { background: radial-gradient(circle at 30% 30%, #64b5f6, var(--color-blue)); }
.ball-red { background: radial-gradient(circle at 30% 30%, #ff8a80, var(--color-red)); }
.ball-gray { background: radial-gradient(circle at 30% 30%, #bdbdbd, var(--color-gray)); }
.ball-green { background: radial-gradient(circle at 30% 30%, #81c784, var(--color-green)); }

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

.draw-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.draw-btn:hover {
    background-color: #357abd;
    transform: translateY(-2px);
}

.draw-btn:active {
    transform: translateY(0);
}

footer {
    margin-top: 2rem;
    font-size: 0.8rem;
    color: #999;
}

@media (max-width: 480px) {
    :root {
        --ball-size: 50px;
    }
    .container {
        padding: 1.5rem;
    }
}
