:root {
    --bg-color: #1a1a2e;
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-end: #16213e;
    --text-color: #e0e0e0;
    --title-color: #ffffff;
    --container-bg: rgba(255, 255, 255, 0.1);
    --container-border: rgba(255, 255, 255, 0.2);
    --btn-bg: #8e44ad;
    --btn-color: #ffffff;
    --ball-shadow-yellow: #fbc531;
    --ball-shadow-blue: #487eb0;
    --ball-shadow-red: #e84118;
    --ball-shadow-gray: #7f8fa6;
    --ball-shadow-green: #27ae60;
}

body.light-mode {
    --bg-color: #f0f2f5;
    --bg-gradient-start: #e4e6eb;
    --bg-gradient-end: #f0f2f5;
    --text-color: #1c1e21;
    --title-color: #000000;
    --container-bg: rgba(255, 255, 255, 0.8);
    --container-border: rgba(0, 0, 0, 0.1);
    --btn-bg: #5a9;
    --btn-color: #ffffff;
}


/* Basic Reset & Font */
body {
    font-family: 'Noto Sans KR', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color); /* Deep dark blue */
    background-image: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 74%); /* Gradient with subtle noise texture */
    color: var(--text-color); /* Light gray text */
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

/* Main container with Glassmorphism effect */
.container {
    background: var(--container-bg);
    border-radius: 20px;
    padding: 2rem 3rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    border: 1px solid var(--container-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    max-width: 90%;
    width: 600px;
    position: relative;
}

.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--container-bg);
    color: var(--title-color);
    border: 1px solid var(--container-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    padding: 0;
    cursor: pointer;
    box-shadow: none;
}

.theme-btn:hover {
    transform: none;
    box-shadow: none;
}
.theme-btn:active {
    transform: none;
    box-shadow: none;
}


/* Title */
h1 {
    font-size: 3rem; /* Larger font size */
    font-weight: 900; /* Bolder */
    color: var(--title-color);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 2rem;
}

body.light-mode h1 {
    text-shadow: none;
}

/* Lottery Balls Container */
.numbers {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    min-height: 80px; /* Prevent layout shift */
}

/* Individual Lottery Ball */
.number {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem; /* Larger number */
    font-weight: 700;
    color: #fff;
    animation: fadeInScale 0.5s ease-out forwards;
    /* Dynamic background color will be added via JS */
}

/* Ball color classes with glow */
.ball-color-1 { background-color: #fbc531; box-shadow: 0 0 20px var(--ball-shadow-yellow); } /* Yellow */
.ball-color-2 { background-color: #487eb0; box-shadow: 0 0 20px var(--ball-shadow-blue); } /* Blue */
.ball-color-3 { background-color: #e84118; box-shadow: 0 0 20px var(--ball-shadow-red); } /* Red */
.ball-color-4 { background-color: #7f8fa6; box-shadow: 0 0 20px var(--ball-shadow-gray); } /* Gray */
.ball-color-5 { background-color: #27ae60; box-shadow: 0 0 20px var(--ball-shadow-green); } /* Green */


/* Generate Button */
.btn {
    background: var(--btn-bg); /* Vibrant purple */
    color: var(--btn-color);
    font-size: 1.5rem;
    font-weight: 700;
    border: none;
    padding: 1rem 2.5rem;
    border-radius: 50px; /* Pill shape */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px var(--btn-bg), 0 0 30px var(--btn-bg), inset 0 0 10px rgba(255,255,255,0.2);
}

.btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 25px var(--btn-bg), 0 0 40px var(--btn-bg), inset 0 0 10px rgba(255,255,255,0.3);
}

.btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 5px 15px var(--btn-bg), 0 0 30px var(--btn-bg), inset 0 0 10px rgba(255,255,255,0.3);
}

/* Animation for balls appearing */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .number {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .btn {
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
    }
}
