:root {
    --bg-color: #f5f5f4;
    --container-bg: #ffffff;
    --text-primary: #1c1917;
    --text-secondary: #78716c;
    --placeholder-bg: #f5f5f4;
    --placeholder-border: #d6d3d1;
    --btn-bg: #4f46e5;
    --btn-hover: #4338ca;
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-color: #1c1917;
    --container-bg: #292524;
    --text-primary: #f5f5f4;
    --text-secondary: #a8a29e;
    --placeholder-bg: #44403c;
    --placeholder-border: #57534e;
    --btn-bg: #6366f1;
    --btn-hover: #4f46e5;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--container-bg);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 10px var(--shadow-color);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s ease, background-color 0.3s ease;
}

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

.container {
    background-color: var(--container-bg);
    padding: 2.5rem 2rem;
    border-radius: 24px;
    box-shadow: 0 10px 25px var(--shadow-color);
    text-align: center;
    max-width: 450px;
    width: 90%;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

h1 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
    transition: color 0.3s ease;
}

.ball-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    min-height: 60px;
}

.placeholder-balls {
    display: flex;
    gap: 12px;
}

.ball {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.ball.placeholder {
    background-color: var(--placeholder-bg);
    border: 2px dashed var(--placeholder-border);
    box-shadow: none;
    opacity: 1;
    transform: scale(1) rotate(0);
    animation: none;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* 로또 공 색상 (동행복권 기준) */
.color-yellow { background-color: #fbc02d; color: #422006; text-shadow: 0 1px 0 rgba(255,255,255,0.3); }
.color-blue { background-color: #3b82f6; }
.color-red { background-color: #ef4444; }
.color-gray { background-color: #71717a; }
.color-green { background-color: #10b981; }

.generate-btn {
    background-color: var(--btn-bg);
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 16px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.generate-btn:hover {
    background-color: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.generate-btn:disabled {
    background-color: #a5b4fc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

body.dark-mode .generate-btn:disabled {
    background-color: #4338ca;
    opacity: 0.7;
}

@keyframes popIn {
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

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