:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --bg-color: var(--light-color);
    --card-bg: #ffffff;
    --text-color: var(--dark-color);
    --shadow-color: rgba(0, 0, 0, 0.1);

    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}

body.dark-mode {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

body {
    font-family: var(--font-family-sans-serif);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.12'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    color: var(--text-color);
}

main {
    text-align: center;
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-color);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    max-width: 90vw;
}

h1 {
    color: var(--text-color);
    margin-bottom: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

#numbers-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    min-height: 80px;
}

.lotto-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    background-color: var(--bg-color);
    padding: 1rem;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px var(--shadow-color);
}

.bonus-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.bonus-indicator {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

#generate-button {
    background: linear-gradient(135deg, var(--primary-color), var(--info-color));
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0, 123, 255, 0.3);
}

#generate-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 123, 255, 0.5);
}

#generate-button:active {
    transform: translateY(-2px);
}

#theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: all 0.3s ease;
    z-index: 1000;
}

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

lotto-ball {
    /* Styles are now handled in the shadow DOM for encapsulation */
}
