.firework {
    position: absolute;
    width: 20px;
    height: 20px;
    
    background: radial-gradient(circle, violet, blue, green, yellow, orange, red);
    border-radius: 50%;
    animation: explode 1s ease-out;
}

@keyframes explode {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(20); opacity: 0; }
}

.emoji {
    position: absolute;
    font-size: 2rem;
    animation: floatUp 1s ease-out;
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-50px) scale(1.5); opacity: 0; }
}

.star {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, gold, orange, transparent);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: explode 1s ease-out;
}

.slider-image {
    transition: opacity 0.5s ease-in-out;
    opacity: 1;
    max-width: 100%;           /* Не больше контейнера */
    max-height: 100%;          /* Не больше контейнера */
    border-radius: 10px;
    object-position: center;
    object-fit: contain; /* Dec 25 2025*/
}

.slider-image.fade-in {
    opacity: 1;
}

.slider-image.fade-out {
    opacity: 0;
}


.slider-nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
}

.prev-slide, .next-slide {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
}

.slider-nav label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.photo-block {
    margin: 20px auto;
    background: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10;
    text-align: center;
}

.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.photo-drop-area {
    border: 2px dashed #ccc;
    padding: 20px;
    cursor: pointer;
}

.photo-drop-area.dragover {
    background: #f0f0f0;
}

.photo-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.photo-slider {
    width: 100%;
}

.slider-container {
    width: 100%;
    height: auto;
    overflow: hidden;
    justify-content: center;    /* ← Горизонтальное центрирование */
    align-items: center;
    display: flex;
}

.photo-filters {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    margin-bottom: 15px;
}

.photo-filters {
    display: flex;
    align-items: center;
    padding: 5px;
    gap: 10px; /* Промежутки между элементами */
}


.photo-thumbnail-wrapper {
    position: relative;
    display: inline-block;
}

.delete-photo-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

/* Заголовок "Галерея фото" */
.photo-title {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.photo-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px 5px 0 0;
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 400; /* Стандартный вес для тулбара */
}



/* Надпись "Ефекти фото" */
.photo-brightness-label {
    font-family: 'Roboto', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

/* Кнопки фильтров */
.photo-filter-btn {
    padding: 5px 10px;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    /*  font-family: 'Roboto', sans-serif; */
    font-size: 14px;
    font-weight: 400;
}

.photo-filter-btn:hover {
    background: #e0e0e0;
}

/* Кнопка удаления блока */
.delete-photo-block {
    background: transparent; /* Прозрачный фон */
    border: none;
    padding: 0;
    cursor: pointer;
}
.video-block {
    width: 100%;
    margin: 10px;
    position: relative;
    z-index: 10;
}

.video-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    background: white; /* По умолчанию белый фон */
    border-radius: 5px;
    position: relative;
}

.toolbar-left {
    display: flex;
    align-items: center;
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.video-drop-area {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #f9f9f9;
    margin-top: 5px;
}

.video-drop-area:hover {
    background-color: #f0f0f0;
}

.video-content {
    max-width: 100%;
    border-radius: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}


.video-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px 5px 0 0;
}

.video-title {
    font-size: 16px;
    font-weight: bold;
}

.video-drop-area {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    margin: 10px 0;
}

.video-drop-area.dragover {
    background: #e0e0e0;
}

.video-preview {
    max-width: 640px; /* Ограничение ширины контейнера, как у .common-block */
    margin: 10px auto; /* Центрирование */
    text-align: center; /* Для центрирования изображения */
}

.video-preview img {
    max-width: 100%; /* Ограничение ширины изображения */
    object-fit: contain; /* Сохранение пропорций */
    width: 100%; /* Заполнение контейнера */
    max-height: 400px; /* Ограничение высоты для больших изображений */
    border-radius: 10px; /* Сохранение стиля */
    display: block; /* Убираем лишние отступы */
}

/* Адаптация для маленьких экранов */
@media screen and (max-width: 720px) {
    .common-block {
        max-width: 100%; /* На экранах меньше 720px занимает всю ширину */
        padding: 8px; /* Уменьшаем внутренние отступы для компактности */
    }
    .video-preview {
        max-width: 100%; /* Адаптация для мобильных */
    }
}

/* Минимальная ширина для совсем узких экранов */
@media screen and (max-width: 360px) {
    .common-block {
        padding: 5px;
    }
    .video-preview {
        max-width: 100%;
    }
}


.color-container {
    position: relative;
    display: inline-block;
}

.color-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
}

.color-menu {
    top: 100%;   /* ПРОВЕРИТЬ! */
} 
.color-menu {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 10px;
    max-height: 300px;           /* Ограничиваем высоту */
    overflow-y: auto;            /* Прокрутка */
    width: 200px;                /* Фиксированная ширина */
}

.color-menu.show {
    display: block !important;  /* На всякий случай */
}

.color-option {
    display: flex;
    align-items: center;
    padding: 2px;
    cursor: pointer;
    border-radius: 5px;
}

.color-option:hover {
    background: #f0f0f0;
}

.color-option .color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin-right: 10px;
    border: 1px solid #ddd;
}

.color-option.custom-color {
    justify-content: space-between;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 20px 0;
    justify-items: center;
    align-items: center;
}

.color-swatch-modal {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd;        /* Общий ободок */
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-swatch-modal.cancel {
    background: transparent;       /* Прозрачный фон */
    border: 3px solid black;     
    color: #dc3545;
    font-weight: bold;
    font-size: 32px;
}

.color-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.color-swatch-modal.custom {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    font-size: 28px;
}

.emoji-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.emoji-modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);  /* 4 в строке */
    gap: 15px;
    margin: 18px 0;
    justify-items: center;
    align-items: center;
}

.emoji-option {
    font-size: 42px;  /* +30% от стандартного */
    cursor: pointer;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #ddd;
}

.emoji-option:hover {
    background: #f0f0f0;
}

.emoji-option.cancel {
    background: transparent;
    border: 3px solid #000;
    color: #000;
    font-weight: bold;
    font-size: 48px;
}

.color-select-wrapper select option span {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: currentColor; /* не обязательно */
    border: 1px solid #999;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 8px;
}


#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
    transform: translateZ(0);
    will-change: transform;
}

.firework,
.star,
.emoji {
    position: absolute;
    transform: translateZ(0);
    will-change: transform, opacity;
}

/* Можно чуть уменьшить scale, чтобы было мягче (по желанию) */
@keyframes explode {
    0% {
        transform: scale(0.8) translateZ(0);
        opacity: 1;
    }
    100% {
        transform: scale(15) translateZ(0);  /* было 20 — можно 12-15 */
        opacity: 0;
    }
}

.direct-image-container {
    text-align: center;
    margin-top: 10px;
}

.direct-image-container img {
    max-width: 100%;
    width: 100%;           /* Важно: заставляем растягиваться по ширине */
    height: auto;          /* Сохраняем пропорции */
    border-radius: 8px;
    border: 5px solid #ffffff;
    box-sizing: border-box; /* Чтобы border не добавлял лишнюю ширину */
    display: block;
    margin: 0 auto;        /* Центрирование, если ширина меньше 100% */
}