:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --subtitle-color: #64748b;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --ball-border: transparent;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Ball Colors */
    --ball-yell: #facc15;
    --ball-blue: #60a5fa;
    --ball-red: #f87171;
    --ball-gray: #94a3b8;
    --ball-green: #4ade80;
}

body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-color: #f1f5f9;
    --subtitle-color: #94a3b8;
    --accent-color: #818cf8;
    --accent-hover: #6366f1;
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -10px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

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;
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    text-align: center;
}

header {
    margin-bottom: 2rem;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
}

#theme-btn {
    background: var(--card-bg);
    border: none;
    padding: 0.75rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

#theme-btn:hover {
    transform: scale(1.1);
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.subtitle {
    color: var(--subtitle-color);
    font-size: 1.125rem;
}

.lotto-card {
    background: var(--card-bg);
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.numbers-display {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.ball {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    box-shadow: inset 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.ball.placeholder {
    background-color: var(--subtitle-color);
    opacity: 0.3;
}

.primary-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.primary-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.4);
}

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

footer {
    margin-top: 2rem;
    color: var(--subtitle-color);
    font-size: 0.875rem;
}

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

/* Ball Color Logic */
.ball.yell { background-color: var(--ball-yell); }
.ball.blue { background-color: var(--ball-blue); }
.ball.red { background-color: var(--ball-red); }
.ball.gray { background-color: var(--ball-gray); }
.ball.green { background-color: var(--ball-green); }

@media (max-width: 480px) {
    .ball {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}
