:root {
    /* Существующие переменные */
    --space-dark: #0a0a2e;
    --neon-blue: #42f5f0;
    --stardust: #d042f5;
    --error-color: salmon;
    --success-color: lightgreen;
    --cancelled-color: orange;
    --accent-purple: #a820c7;
    
    /* Новые переменные для улучшенной цветовой схемы */
    --cosmic-dark: #0a0a16;
    --nebula-purple: #1a1a2e;
    --stellar-blue: #16213e;
    --text-primary: #f0f8ff;
    --text-secondary: #c0d6e8;
    --text-muted: #8a9ba8;
}

/* Улучшенный космический фон */
.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(76, 201, 240, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(123, 79, 255, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--cosmic-dark) 0%, var(--space-dark) 100%);
    z-index: -2;
}
.twinkling {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: twinkling 4s ease-in-out infinite alternate;
}

.cosmic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(108, 99, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(76, 201, 240, 0.05) 0%, transparent 50%);
}

@keyframes stars-drift {
    from { transform: translateY(0); }
    to { transform: translateY(-200px); }
}

@keyframes twinkling {
    from { opacity: 0.5; }
    to { opacity: 1; }
}

/* Улучшенная типографика */
body {
    font-family: 'Space Grotesk', 'Space Mono', monospace;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-primary);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

/* Улучшенные уведомления */
.toast {
    font-weight: 500;
    backdrop-filter: blur(10px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100vw;
    overflow-x: hidden;
    font-family: 'Space Mono', monospace;
    color: #fff;
    line-height: 1.5;
    list-style: none;
    /* Улучшение: лучшая читаемость */
    font-weight: 500;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Улучшение: лучшая адаптивность для мобильных */
@media (min-width: 769px) {
    html {
        height: 100vh;
        overflow-y: hidden;
    }
    body {
        height: 100%;
        overflow-y: auto;
        position: static;
        width: 100%;
    }
}

@media (max-width: 768px) {
    html, body {
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        position: relative;
        /* Улучшение: лучший размер шрифта на мобильных */
        font-size: 16px;
    }
}

.cosmic-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(
        ellipse at bottom,
        var(--space-dark) 0%,
        #000 100%
    );
    z-index: -2;
}

.stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("/static/image/bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30, 30, 50, 0.95);
    color: var(--neon-blue);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 10000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-left: 4px solid var(--stardust);
    font-size: 0.95rem;
    max-width: 300px;
    backdrop-filter: blur(5px);
    /* Улучшение: лучшая читаемость уведомлений */
    font-weight: 500;
}

.toast.success {
    border-left-color: var(--success-color);
    color: #fff;
    background: rgba(20, 80, 30, 0.95);
}

.toast.error {
    border-left-color: var(--error-color);
    color: #fff;
    background: rgba(80, 20, 30, 0.95);
}

.toast.info {
    border-left-color: var(--neon-blue);
    color: var(--neon-blue);
    background: rgba(30, 30, 50, 0.95);
}

.toast.cancelled {
    border-left-color: var(--cancelled-color);
    color: #fff;
    background: rgba(80, 50, 20, 0.95);
}

@keyframes toast-in {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.toast {
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (max-width: 768px) {
    .toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--stardust);
    border-radius: 3px;
}

/* Улучшение: лучшая читаемость заголовков */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

/* Улучшение: контрастность текста */
p, span, div {
    color: #e8f4f8;
}