* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: align-items 0.5s ease;
}

body.has-results {
    align-items: flex-start;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    padding-bottom: 50px;
    padding-top: 80px;
    max-width: 800px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    transition: max-width 0.5s ease, padding 0.5s ease;
}

.container.expanded {
    max-width: 1200px;
    animation: expandContainer 0.5s ease;
}

@keyframes expandContainer {
    from {
        transform: scale(0.95);
        opacity: 0.8;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 2em;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
}

.mode-btn {
    padding: 10px 30px;
    border: 4px solid #000000;
    background: white;
    color: #000000;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-btn:hover {
    background: #f0f0f0;
}

.mode-btn.active {
    background: #000000;
    color: white;
}

.upload-area {
    border: 3px solid #000000;
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    background: #f9f9f9;
    border-color: #292929;
}

.upload-area.dragover {
    background: #e8eaf6;
    border-color: #764ba2;
}

#fileInput {
    display: none;
}

.upload-text {
    color: #000000;
    font-size: 1.1em;
    margin-bottom: 10px;
}

.process-btn {
    background: #ffffff;
    color: black;
    border: 3px solid #000000;
    padding: 15px 60px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin: -10px auto 0px;
    transition: none;
}

.process-btn:hover {
    background: #f0f0f0;
    border: 3px solid #000000;
}

.process-btn:disabled {
    background: #ffffff;
    cursor: not-allowed;
    transform: none;
    border: 3px solid #000000;
    opacity: 1;
}

.preview {
    margin-top: 30px;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preview h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.preview-item {
    text-align: center;
    animation: fadeInScale 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.preview-canvas {
    max-width: 100%;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.download-all-btn {
    background: #ffffff;
    color: black;
    border: 3px solid #000000;
    padding: 15px 60px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    display: block;
    margin: 50px auto 0;
    transition: none;
}

.download-all-btn:hover {
    background: #f0f0f0;
    border: 3px solid #000000;
}

#canvasContainer {
    display: none;
}

.loading {
    text-align: center;
    color: #667eea;
    font-size: 1.1em;
    margin: 20px 0;
}

.stars {
    position: fixed;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    pointer-events: none;
    z-index: 0;
    transform-origin: 66.67% 66.67%;
    animation: rotateStars 200s linear infinite;
}

@keyframes rotateStars {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(-360deg);
    }
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

.aether-logo {
    position: absolute;
    top: 30px;
    left: 40px;
    width: 150px;            /* размер логотипа */
    height: auto;
    z-index: 10;            /* поверх всего */
    pointer-events: none;   /* чтобы не мешал кликам */
}

.footer-btn {
    background: #ffffff;
    color: black;
    border: 3px solid #000000;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    transition: none;
    position: relative;
    z-index: 1;
    text-decoration: none;

    /* Ключевые изменения */
    min-width: 100px;
    width: fit-content;
    box-sizing: border-box;

    /* Центрирование */
    display: flex;           /* меняем на flex (блочный) */
    margin: 50px auto 0;     /* auto по горизонтали = центрирование */
    max-width: 300px;        /* опционально: ограничить максимум */
}

/* Родительский контейнер (рекомендуется) */
.footer-btn-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

.footer-btn-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}