:root {
    color-scheme: light;
    --bg: #f7f4ef;
    --text: #1f1b16;
    --panel: #fff6e9;
    --panel-border: #e6d8c7;
    --button: #1f7a45;
    --button-hover: #17633a;
    --toolbar: #efe6db;
    --toolbar-border: #dbcdbd;
    --link: #2d5fb3;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #121212;
    --text: #ffffff;
    --panel: #1f1f1f;
    --panel-border: #2d2d2d;
    --button: #4caf50;
    --button-hover: #45a049;
    --toolbar: #1a1a1a;
    --toolbar-border: #2a2a2a;
    --link: #8fb4ff;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    text-align: center;
    padding: 2rem 1.5rem 3rem;
}

h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
}

.toolbar {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar button,
.nav-link {
    background-color: var(--toolbar);
    color: var(--text);
    border: 1px solid var(--toolbar-border);
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toolbar button:hover,
.nav-link:hover {
    background-color: var(--panel);
    transform: translateY(-1px);
}

.machine {
    background-color: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    width: 400px;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

@media (max-width: 520px) {
    .machine {
        width: 90vw;
        height: 260px;
        padding: 1.5rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    .numbers {
        flex-direction: column;
        gap: 12px;
    }
}

.ball-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    animation: roll 0.5s ease-in-out infinite alternate;
    position: absolute;
}

@keyframes roll {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-20px) rotate(360deg);
    }
}

#draw-button {
    background-color: var(--button);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

#draw-button:hover {
    background-color: var(--button-hover);
}

.result {
    margin-top: 2rem;
}

.numbers {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.number-group, .bonus-group {
    display: flex;
    gap: 10px;
}

.number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
}

.number:not(:empty) {
    animation: appear 0.5s ease-in-out;
}

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

.bonus {
    background-color: #f44336;
}

.contact {
    margin-top: 2.5rem;
    padding: 1.75rem;
    border-radius: 18px;
    background-color: var(--panel);
    border: 1px solid var(--panel-border);
}

.contact-subtitle {
    margin: 0.5rem 0 1.5rem;
    opacity: 0.8;
}

.contact-form {
    display: grid;
    gap: 1rem;
    max-width: 520px;
    margin: 0 auto;
}

.field {
    display: grid;
    gap: 0.4rem;
    text-align: left;
    font-weight: 600;
}

.field input,
.field textarea {
    width: 100%;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    background-color: var(--bg);
    color: var(--text);
    font-size: 1rem;
}

.field textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-submit {
    background-color: var(--button);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.9rem 1.4rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.contact-submit:hover {
    background-color: var(--button-hover);
}

.comments {
    margin-top: 2.5rem;
    padding: 1.75rem;
    border-radius: 18px;
    background-color: var(--panel);
    border: 1px solid var(--panel-border);
}

#disqus_thread {
    margin-top: 1.2rem;
    color: #1f1b16;
}

html[data-theme="dark"] #disqus_thread {
    color: #e6e6e6;
}

#disqus_thread a {
    color: var(--link);
}
