:root {
    --page-background: #f4f7fb;
    --page-gradient: linear-gradient(135deg, #e8f5ff 0%, #f8fbff 45%, #eaf7ef 100%);
    --text-color: #263238;
    --panel-background: rgba(255, 255, 255, 0.86);
    --panel-shadow: 0 10px 20px rgba(20, 30, 45, 0.18), 0 6px 6px rgba(20, 30, 45, 0.12);
    --heading-color: #1d3557;
    --button-background: #2474a6;
    --button-hover: #1a5f8d;
    --button-text: #ffffff;
    --toggle-background: rgba(255, 255, 255, 0.72);
    --toggle-border: rgba(36, 116, 166, 0.32);
    --toggle-text: #1d3557;
}

body[data-theme="dark"] {
    --page-background: #121417;
    --page-gradient: linear-gradient(135deg, #121417 0%, #1d2630 52%, #0f2019 100%);
    --text-color: #edf2f4;
    --panel-background: rgba(22, 27, 34, 0.88);
    --panel-shadow: 0 12px 26px rgba(0, 0, 0, 0.38), 0 6px 10px rgba(0, 0, 0, 0.28);
    --heading-color: #f6f8fa;
    --button-background: #2f8f9d;
    --button-hover: #257783;
    --button-text: #ffffff;
    --toggle-background: rgba(34, 41, 49, 0.86);
    --toggle-border: rgba(143, 173, 190, 0.38);
    --toggle-text: #f6f8fa;
}

body {
    font-family: 'Helvetica Neue', sans-serif;
    background-color: var(--page-background);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background-image: var(--page-gradient);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    background-color: var(--panel-background);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--panel-shadow);
    text-align: center;
    max-width: 500px;
    width: 90%;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

h1 {
    color: var(--heading-color);
    margin: 0;
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1.1;
    text-align: left;
    transition: color 0.3s ease;
}

.theme-toggle {
    flex: 0 0 auto;
    background-color: var(--toggle-background);
    border: 1px solid var(--toggle-border);
    border-radius: 8px;
    color: var(--toggle-text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.65rem 0.85rem;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.theme-toggle:hover {
    transform: translateY(-1px);
}

.numbers-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.number-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color 0.3s ease;
    transform: scale(0);
    animation: pop-in 0.5s ease forwards;
}

@keyframes pop-in {
    to {
        transform: scale(1);
    }
}

#generate-btn {
    background-color: var(--button-background);
    color: var(--button-text);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
}

#generate-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

#generate-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(50, 50, 93, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08);
}

@media (max-width: 480px) {
    .top-bar {
        align-items: stretch;
        flex-direction: column;
    }

    h1 {
        text-align: center;
    }

    .number-circle {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    h1 {
        font-size: 2rem;
    }

    #generate-btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}
