:root {
    --primary-color: #4a90e2;
    --background-color: #f0f2f5;
    --container-bg: #ffffff;
    --text-color: #333333;
    --ball-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    --button-glow: 0 0 15px rgba(74, 144, 226, 0.6);
    --pattern-color: #f9f9f9;
}

[data-theme="dark"] {
    --background-color: #1a1a1a;
    --container-bg: #2d2d2d;
    --text-color: #f0f2f5;
    --pattern-color: #252525;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: linear-gradient(45deg, var(--pattern-color) 25%, transparent 25%),
                      linear-gradient(-45deg, var(--pattern-color) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, var(--pattern-color) 75%),
                      linear-gradient(-45deg, transparent 75%, var(--pattern-color) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    transition: background-color 0.3s, color 0.3s;
}

.container {
    position: relative;
    text-align: center;
    background: var(--container-bg);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 500px;
    transition: background-color 0.3s, box-shadow 0.3s;
}

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

#theme-button {
    background: none;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

#theme-button:hover {
    background: var(--primary-color);
    color: white;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 30px;
}

#lotto-numbers-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    flex-wrap: wrap;
    min-height: 60px;
}

.placeholder-text {
    font-size: 1.2rem;
    color: var(--text-color);
    opacity: 0.6;
    margin: 0;
}

#generate-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.4);
}

#generate-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(74, 144, 226, 0.5);
}

#generate-button:active {
    transform: translateY(0);
    box-shadow: var(--button-glow);
}

lotto-ball {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--ball-shadow);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4em;
    font-weight: bold;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
    lotto-ball {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }
    #lotto-numbers-container {
        gap: 10px;
    }
}
