:root {
    --bg-color: #1a1a2e;
    --container-bg: #16213e;
    --text-color: #e94560;
    --text-main: #ffffff;
    --sub-text: #a0a0a0;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --white: #ffffff;
    
    /* Ball Colors (Standard Korean Lotto) */
    --ball-yellow: #fbc400;
    --ball-blue: #69c8f2;
    --ball-red: #ff7272;
    --ball-gray: #aaaaaa;
    --ball-green: #b0d840;
}

body.light-mode {
    --bg-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #e94560;
    --text-main: #1a1a2e;
    --sub-text: #666666;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.container {
    background-color: var(--container-bg);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-color);
    text-align: center;
    width: 90%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

/* Theme Toggle Style */
.theme-toggle {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: all 0.3s ease;
}

body.light-mode .theme-toggle {
    background: rgba(0, 0, 0, 0.05);
}

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

.theme-toggle .sun { display: none; }
.theme-toggle .moon { display: block; }

body.light-mode .theme-toggle .sun { display: block; }
body.light-mode .theme-toggle .moon { display: none; }

/* Subtle background pattern/glow */
.container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(233, 69, 96, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

header {
    position: relative;
    z-index: 1;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

p {
    color: var(--sub-text);
    font-size: 1rem;
}

.display-area {
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.balls-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.placeholder-text {
    color: var(--sub-text);
    font-style: italic;
    animation: pulse 2s infinite;
}

.ball {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333; /* Dark text for better contrast on light balls */
    box-shadow: inset -5px -5px 10px rgba(0,0,0,0.3), 
                inset 5px 5px 10px rgba(255,255,255,0.3),
                0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    transform: scale(0); /* Start hidden for animation */
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Ball Color Variants */
.ball.yellow { background: var(--ball-yellow); color: #333; }
.ball.blue { background: var(--ball-blue); color: #fff; }
.ball.red { background: var(--ball-red); color: #fff; }
.ball.gray { background: var(--ball-gray); color: #fff; }
.ball.green { background: var(--ball-green); color: #fff; }

.generate-btn {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    background: linear-gradient(45deg, #ff416c, #ff4b2b);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(255, 65, 108, 0.4);
    position: relative;
    z-index: 1;
    outline: none;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 65, 108, 0.6);
}

.generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 65, 108, 0.4);
}

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

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 2rem;
        width: 95%;
    }
    .ball {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    h1 {
        font-size: 2rem;
    }
}
