* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: fixed;
    background: #000000;
}

/* Предупреждение для десктопа */
.device-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.device-warning.hidden {
    display: none;
}

.warning-content {
    text-align: center;
    color: white;
    max-width: 500px;
}

.warning-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    animation: pulse 2s ease-in-out infinite;
}

.warning-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.warning-text {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.warning-footer {
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.warning-footer p {
    font-size: 1rem;
    opacity: 0.8;
    line-height: 1.5;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Фоновое видео */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Затемняющий оверлей */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Контейнер слайдов */
.slides-container {
    width: 100%;
    height: 100%;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.slides-container::-webkit-scrollbar {
    display: none;
}

/* Слайды */
.slide {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    padding: 20px;
}

.slide-content {
    text-align: center;
    color: white;
    max-width: 90%;
}

.slide-title {
    font-size: clamp(3rem, 12vw, 5.5rem);
    font-weight: 600;
    margin-bottom: 2rem;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
    letter-spacing: 0.02em;
}

.slide-text {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    line-height: 1.8;
    text-shadow: 0 3px 15px rgba(0, 0, 0, 0.8);
    opacity: 0.98;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* Слайд с сертификатом */
.slide-certificate {
    padding: 10px;
    background: #000000;
    position: relative;
    z-index: 2;
}

/* Скрыть видео-фон когда на слайде с сертификатом */
.video-background.hidden {
    opacity: 0;
    pointer-events: none;
}

.certificate-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.certificate-hint {
    text-align: center;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    padding: 0 20px;
}

.certificate-wrapper {
    position: relative;
    width: 100%;
    max-width: 95%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    cursor: pointer;
}

.certificate-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.certificate-image:active {
    transform: scale(0.98);
}

/* Режим полноэкранного просмотра сертификата */
.certificate-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.certificate-fullscreen .certificate-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    cursor: zoom-out;
}

.certificate-fullscreen .certificate-image:active {
    transform: none;
}

.certificate-close-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 0.9rem;
    opacity: 0.8;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* Индикаторы слайдов */
.slide-indicators {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.indicator.active {
    background: white;
    height: 24px;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Анимации */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Оптимизация для портретной ориентации (9:16) */
@media (orientation: portrait) {
    .video-background video {
        width: 100%;
        height: auto;
    }

    .slide-content {
        max-width: 85%;
    }
}

/* Оптимизация для ландшафтной ориентации */
@media (orientation: landscape) {
    .video-background video {
        width: auto;
        height: 100%;
    }

    .slide-content {
        max-width: 70%;
    }
}

/* Адаптивность для маленьких экранов */
@media (max-width: 375px) {
    .slide-title {
        margin-bottom: 1rem;
    }

    .indicator {
        width: 6px;
        height: 6px;
    }

    .indicator.active {
        height: 20px;
    }

    .slide-indicators {
        right: 15px;
        gap: 10px;
    }
}

/* Адаптивность для больших экранов */
@media (min-width: 768px) {
    .slide-content {
        max-width: 600px;
    }
}

/* Улучшенная читаемость текста */
@supports (text-rendering: optimizeLegibility) {
    .slide-title,
    .slide-text {
        text-rendering: optimizeLegibility;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Предотвращение выделения текста на мобильных */
.slide-content {
    -webkit-user-select: none;
    user-select: none;
}

/* iOS Safari фиксы */
@supports (-webkit-touch-callout: none) {
    .slide {
        height: -webkit-fill-available;
    }
}
