:root {
    --primary-color: #f39c12;
    --secondary-color: #e74c3c;
    --background-color: #2c3e50;
    --text-color: #ecf0f1;
    --ball-size: 60px;
    --card-bg: rgba(255, 255, 255, 0.05);
}

body.light-mode {
    --background-color: #f5f6fa;
    --text-color: #2f3640;
    --card-bg: rgba(0, 0, 0, 0.05);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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;
    background: var(--card-bg);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    max-width: 90vw;
}

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.lotto-numbers-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 40px 0;
    min-height: 80px;
}

#generate-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 1.25rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

#generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
}

#generate-btn:active {
    transform: scale(0.98);
}

.history-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--card-bg);
}

.history-section h2 {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 20px;
}

#history-list {
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.history-item {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--card-bg);
    border-radius: 12px;
    animation: slideIn 0.3s ease-out;
}

.history-ball {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.secondary-btn {
    margin-top: 20px;
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: var(--secondary-color);
    color: white;
}

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.contact-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--card-bg);
    text-align: left;
}

.contact-section h2 {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 20px;
    text-align: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    border: 1px solid var(--card-bg);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(243, 156, 18, 0.2);
}

.submit-btn {
    background: var(--text-color);
    color: var(--background-color);
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.2s;
}

.submit-btn:hover {
    opacity: 0.8;
}

.comments-section {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--card-bg);
    text-align: left;
}

.comments-section h2 {
    font-size: 1.2rem;
    opacity: 0.7;
    margin-bottom: 20px;
    text-align: center;
}

.theme-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

lotto-ball {
    display: inline-block;
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

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

@media (max-width: 480px) {
    h1 { font-size: 1.8rem; }
    --ball-size: 50px;
    .container { padding: 1rem; }
}
