* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --page-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --panel-bg: #ffffff;
    --panel-shadow: rgba(0, 0, 0, 0.3);
    --text-main: #333333;
    --text-muted: #666666;
    --text-soft: #999999;
    --surface-bg: #f9f9f9;
    --surface-strong: #ffffff;
    --line-color: #f0f0f0;
    --secondary-btn-bg: #f0f0f0;
    --secondary-btn-hover: #e0e0e0;
    --accent-start: #667eea;
    --accent-end: #764ba2;
    --bonus-color: #f5576c;
}

body.dark-mode {
    --page-bg: linear-gradient(135deg, #151823 0%, #2f254a 100%);
    --panel-bg: #171b26;
    --panel-shadow: rgba(0, 0, 0, 0.55);
    --text-main: #f4f7fb;
    --text-muted: #c6ccd8;
    --text-soft: #8f98aa;
    --surface-bg: #202635;
    --surface-strong: #111520;
    --line-color: #2e3546;
    --secondary-btn-bg: #2a3142;
    --secondary-btn-hover: #343c50;
    --accent-start: #7c93ff;
    --accent-end: #9b6bd3;
    --bonus-color: #ff7d91;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--page-bg);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s ease;
}

.container {
    background: var(--panel-bg);
    border-radius: 20px;
    box-shadow: 0 20px 60px var(--panel-shadow);
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.theme-toggle {
    position: absolute;
    top: 18px;
    right: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-width: 104px;
    padding: 9px 12px;
    border-radius: 999px;
    background: var(--surface-bg);
    color: var(--text-main);
    box-shadow: none;
    font-size: 13px;
    letter-spacing: 0;
    text-transform: none;
}

.theme-toggle:hover {
    background: var(--secondary-btn-hover);
    transform: translateY(-1px);
}

.theme-icon {
    line-height: 1;
}

h1 {
    color: var(--text-main);
    margin-bottom: 10px;
    font-size: 32px;
}

.subtitle {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 14px;
}

.lottery-numbers {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.number-ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: transform 0.3s ease;
}

.number-ball:hover {
    transform: scale(1.1);
}

.number-ball.bonus {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
    width: 45px;
    height: 45px;
    font-size: 18px;
}

.bonus-label {
    width: 100%;
    margin-top: 10px;
    color: var(--bonus-color);
    font-size: 12px;
    font-weight: bold;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.draw-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.draw-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.draw-btn:active {
    transform: translateY(0);
}

.reset-btn {
    background: var(--secondary-btn-bg);
    color: var(--text-main);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.reset-btn:hover {
    background: var(--secondary-btn-hover);
    transform: translateY(-2px);
}

.history {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--line-color);
}

.history h3 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 16px;
}

.history-item {
    background: var(--surface-bg);
    padding: 10px;
    margin: 8px 0;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item .numbers {
    font-weight: bold;
    color: var(--text-main);
}

.bonus-number {
    color: var(--bonus-color);
    font-weight: bold;
}

.history-time {
    font-size: 11px;
    color: var(--text-soft);
    margin-top: 4px;
}

.delete-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: #ff5252;
}

.empty-history {
    color: var(--text-soft);
    font-size: 13px;
    padding: 10px;
}

.statistics {
    margin-top: 20px;
    padding: 15px;
    background: var(--surface-bg);
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-item {
    background: var(--surface-strong);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--accent-start);
}

.stat-label {
    font-size: 12px;
    color: var(--text-soft);
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-main);
}

.partner-inquiry {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--line-color);
    text-align: left;
}

.partner-inquiry h3 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

.partner-inquiry form {
    display: grid;
    gap: 10px;
}

.partner-inquiry label {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: bold;
}

.partner-inquiry input,
.partner-inquiry textarea {
    width: 100%;
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: var(--surface-bg);
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    padding: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

.partner-inquiry textarea {
    resize: vertical;
    min-height: 110px;
}

.partner-inquiry input:focus,
.partner-inquiry textarea:focus {
    border-color: var(--accent-start);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
    outline: none;
}

.submit-btn {
    margin-top: 6px;
    background: linear-gradient(135deg, var(--accent-start) 0%, var(--accent-end) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.form-status {
    min-height: 18px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.form-status.success {
    color: #1f9d55;
}

.form-status.error {
    color: #ff6b6b;
}

.comments-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--line-color);
    text-align: left;
}

.comments-section h3 {
    color: var(--text-main);
    margin-bottom: 15px;
    font-size: 16px;
    text-align: center;
}

#disqus_thread {
    min-height: 180px;
}

@keyframes pop {
    0% {
        transform: scale(0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 25px;
    }

    .theme-toggle {
        position: static;
        margin: 0 0 18px auto;
    }

    h1 {
        font-size: 24px;
    }

    .number-ball {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .button-group {
        flex-direction: column;
    }
}
