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

body {
    background: #000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    /* Отключаем двойной тап зум на мобiles */
    touch-action: manipulation;
}

.container {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Stage 12 container*/
.container.stage12 {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 9 / 16;
    border-radius: 20px;
    overflow: hidden;
}

/* Видеоэлемент */
#video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transition: transform 0.3s ease;
    transform-origin: center;
    /* Скрываем все встроенные контролы */
    -webkit-appearance: none;
    appearance: none;
    /* Полностью отключаем взаимодействие с видео */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1;
    border-radius: 20px;
    overflow: hidden; /* ← ВОТ ЭТО НУЖНО */
    opacity: 1;
    visibility: visible;
    display: block;
}

/* Video2 - на экране документа (идентично video) */
#video2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    transition: transform 0.3s ease;
    transform-origin: center;
    /* Скрываем все встроенные контролы */
    -webkit-appearance: none;
    appearance: none;
    /* Полностью отключаем взаимодействие с видео */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1;
    /* 🎯 КРИТИЧНО: ПО УМОЛЧАНИЮ СКРЫТ (показывается только когда .document-screen.active) */
    display: none;
    border-radius: 20px;
    overflow: hidden; /* ← ВОТ ЭТО НУЖНО */
}

/* Video2 видимо ТОЛЬКО когда документ экран активен */
.document-screen.active #video2 {
    display: block;
}

/* ===== ПОЛНОЕ СКРЫТИЕ ВСЕХ ВСТРОЕННЫХ КОНТРОЛОВ ===== */

/* Webkit браузеры (Chrome, Safari, Edge) */
video::-webkit-media-controls,
#video::-webkit-media-controls {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-panel,
#video::-webkit-media-controls-panel {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-play-button,
#video::-webkit-media-controls-play-button,
video::-webkit-media-controls-pause-button,
#video::-webkit-media-controls-pause-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
}

video::-webkit-media-controls-timeline,
#video::-webkit-media-controls-timeline {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-time-display,
#video::-webkit-media-controls-time-display {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-fullscreen-button,
#video::-webkit-media-controls-fullscreen-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

video::-webkit-media-controls-enclosure,
#video::-webkit-media-controls-enclosure {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Mozilla Firefox */
video::-moz-media-controls,
#video::-moz-media-controls {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Общие стили для всех видео элементов */
video::cue,
#video::cue {
    display: none !important;
}

/* Убираем context menu */
#video::selection {
    display: none !important;
}

/* Полностью скрываем все оверлеи паузы/возобновления */
video::play-button {
    display: none !important;
}

/* Блокируем все интерактивные элементы видео */
video::-webkit-media-text-track-container {
    display: none !important;
}

#video {
    -webkit-touch-callout: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Рамка-изображение (оверлей, не записывается в видео) */
.overlay-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    z-index: 10;
    display: none;
    opacity: 1;
    visibility: visible;
}

/* ===== STAGE 11: DOCUMENT OVERLAYS ===== */

/* Stage 11 - document_layer1.png (Passport) */
.document-screen.active #documentOverlay.doc-passport {
    position: absolute !important;
    top: 44% !important;
    left: 50% !important;
    width: 100% !important;
    height: 100% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 0.5 !important;
    z-index: 10 !important;
    display: block !important;
}

/* Stage 11 - document_layer2.png (ID Card) */
.document-screen.active #documentOverlay.doc-idcard {
    position: absolute !important;
    top: 45% !important;
    left: 50% !important;
    width: 100% !important;
    height: 100% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 0.5 !important;
    z-index: 10 !important;
    display: block !important;
}

/* Stage 11 - document_layer3.png (Driver's License) */
.document-screen.active #documentOverlay.doc-dl {
    position: absolute !important;
    top: 45% !important;
    left: 50% !important;
    width: 100% !important;
    height: 100% !important;
    transform: translate(-50%, -50%) !important;
    opacity: 0.5 !important;
    z-index: 10 !important;
    display: block !important;
}

/* ===== STAGE 12: SELFIE WITH DOCUMENT ===== */

/* Stage 12 Face OVERLAY (0_face_layer.png) */
.container.stage12 #stage12Overlay {
    width: 100% !important;
    height: 75% !important;
    top: 40% !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(-50%) scale(1.0) !important;
    position: absolute !important;
    z-index: 12;
}

/* Stage 12 Passport OVERLAY (document_layer1.png) */
.container.stage12 #faceOverlayStatic.stage12-doc-overlay.passport {
    width: 100% !important;
    height: 35% !important;
    top: 59% !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(-50%) scale(1.6) !important;
    transform-origin: top center !important;
    position: absolute !important;
    display: block !important;
    z-index: 15;
    opacity: 0.5 !important;
}

/* Stage 12 ID Card / Driver's License OVERLAY (document_layer2.png) */
.container.stage12 #faceOverlayStatic.stage12-doc-overlay.idcard-dl {
    width: 100% !important;
    height: 40% !important;
    top: 54% !important;
    left: 0 !important;
    right: 0 !important;
    transform: translateY(-50%) scale(1.8) !important;
    transform-origin: top center !important;
    position: absolute !important;
    display: block !important;
    z-index: 15;
    opacity: 0.5 !important;
}

/* Stage 12 Selfie Passport IMAGE (selfie1.png) */
.container.stage12 #selfie1Image.stage12 {
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 50;
}

/* Stage 12 Selfie ID Card / Driver's License IMAGE (selfie2.png) */
.container.stage12 #selfie2Image.stage12 {
    position: absolute;
    display: block;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: auto;
    height: auto;
    max-width: 90%;
    max-height: 90%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 50;
}

/* Stage 12 GO button  */
.container.stage12 #goBtn {
    bottom: 10px !important;
}

/* Таймер в оверлее */
.overlay-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 25;
    display: none;
}

.timer-text {
    font-size: 80px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    font-family: 'Courier New', monospace;
    opacity: 0.3;
}

/* Отображение цифр для произнесения */
.digits-display {
    position: absolute;
    top: 75%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 24;
    display: flex;
    justify-content: center;
    align-items: center;
    width: auto;
    min-width: 300px;
}

.digits-text {
    font-size: 70px;
    font-weight: bold;
    color: white;
    text-shadow: 3px 3px 12px rgba(0, 0, 0, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 10px;
    opacity: 0.9;
    white-space: nowrap;
}

/* Front image for face verification - центр, 80% размер */
.front-image {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    width: auto;
    height: auto;
    min-width: 100px;
    min-height: 100px;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
    contain: layout style paint;
    backface-visibility: hidden;
}

/* Front image on Stage 2 - уменьшаем до 1.0 размера */
.front-image.stage2 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 3 - уменьшаем до 1.0 размера */
.front-image.stage3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 3 with .moved class - пропорциональное уменьшение */
.front-image.stage3.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Front image on Stage 4 - уменьшаем до 1.0 размера */
.front-image.stage4 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 5 - уменьшаем до 1.0 размера */
.front-image.stage5 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 5 with .moved class - пропорциональное уменьшение */
.front-image.stage5.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Front image on Stage 6 - уменьшаем до 1.0 размера */
.front-image.stage6 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 6 with .moved class - пропорциональное уменьшение */
.front-image.stage6.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.5) !important;
}

/* Front image moved up (10% размер, выше кнопки NEXT) */
.front-image.moved {
    top: auto;
    bottom: 15px;
    transform: translateX(-50%) scale(0.4);
}

/* Up-Right image for Stage 6 - диагонально ввверх-вправо */
.up-right-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.up-right-image.moved {
    top: auto;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) scale(0.55);
}

/* Half-Right image for Stage 6 - справа */
.half-right-image {
    position: absolute;
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.half-right-image.moved {
    top: auto;
    bottom: 15px;
    left: 55%;
    transform: translateX(-50%) scale(0.55);
}

/* Down-Right image for Stage 6 - диагонально вниз-вправо */
.down-right-image {
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.down-right-image.moved {
    top: auto;
    bottom: 15px;
    left: 55%;
    transform: translateX(-50%) scale(0.55);
}

/* Down-Left image for Stage 6 - диагонально вниз-влево */
.down-left-image {
    position: absolute;
    top: 50%;
    left: 45%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.down-left-image.moved {
    top: auto;
    bottom: 15px;
    left: 45%;
    transform: translateX(-50%) scale(0.55);
}

/* Half-Left image for Stage 6 - слева */
.half-left-image {
    position: absolute;
    top: 50%;
    left: 40%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.half-left-image.moved {
    top: auto;
    bottom: 15px;
    left: 45%;
    transform: translateX(-50%) scale(0.55);
}

/* Up-Left image for Stage 6 - диагонально ввверх-влево */
.up-left-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.up-left-image.moved {
    top: auto;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) scale(0.55);
}

/* Left image for Stage 2 - слегка левее */
.left-image {
    position: absolute;
    top: 50%;
    left: 30%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.left-image.moved {
    top: auto;
    bottom: 15px;
    left: 30%;
    transform: translate(-50%, 0) scale(0.4);
}

/* Right image for Stage 2 - слегка правее */
.right-image {
    position: absolute;
    top: 50%;
    left: 70%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

.right-image.moved {
    top: auto;
    bottom: 15px;
    left: 70%;
    transform: translate(-50%, 0) scale(0.4);
}

/* Left image for Stage 4 - слегка левее */
.left-image.stage4 {
    top: 50%;
    left: 40%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Left image on Stage 4 with .moved class - пропорциональное уменьшение */
.left-image.stage4.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 40% !important;
    transform: translate(-50%, 0) scale(0.4) !important;
}

/* Right image for Stage 4 - слегка правее */
.right-image.stage4 {
    top: 50%;
    left: 60%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Right image on Stage 4 with .moved class - пропорциональное уменьшение */
.right-image.stage4.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 60% !important;
    transform: translate(-50%, 0) scale(0.4) !important;
}

/* Up image for Stage 3 - слегка выше */
.up-image {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Up image on Stage 3 - отдельный блок для Stage 3 */
.up-image.stage3 {
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Up image on Stage 3 with .moved class - пропорциональное уменьшение */
.up-image.stage3.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Up image on Stage 5 - уменьшаем до 1.0 размера перед GO */
.up-image.stage5 {
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Up image on Stage 5 with .moved class - пропорциональное уменьшение */
.up-image.stage5.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

.up-image.moved {
    top: auto !important;
    bottom: 15px !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Down image for Stage 3 - слегка ниже */
.down-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Down image on Stage 3 - отдельный блок для Stage 3 */
.down-image.stage3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Down image on Stage 3 with .moved class - пропорциональное уменьшение */
.down-image.stage3.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.5) !important;
}

/* Down image on Stage 5 - уменьшаем до 1.0 размера перед GO */
.down-image.stage5 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.2);
}

/* Down image on Stage 5 with .moved class - пропорциональное уменьшение */
.down-image.stage5.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.5) !important;
}

.down-image.moved {
    top: auto !important;
    bottom: 15px !important;
    transform: translateX(-50%) scale(0.5) !important;
}

/* Up image on Stage 6 - отдельный блок для Stage 6 */
.up-image.stage6 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Down image on Stage 6 - отдельный блок для Stage 6 */
.down-image.stage6 {
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Up image on Stage 6 with .moved class - пропорциональное уменьшение */
.up-image.stage6.moved {
    top: 45% !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.45) !important;
}

/* Down image on Stage 6 with .moved class - пропорциональное уменьшение */
.down-image.stage6.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.55) !important;
}

/* ===== STAGE 7: BLINKING (Мигание) ===== */

/* Front image on Stage 7 - уменьшаем до 1.0 размера */
.front-image.stage7 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 7 with .moved class - пропорциональное уменьшение */
.front-image.stage7.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Blink image for Stage 7 */
.blink-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Blink image on Stage 7 - базовый размер для Stage 7 */
.blink-image.stage7 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Blink image on Stage 7 with .moved class - пропорциональное уменьшение */
.blink-image.stage7.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* ===== STAGE 8: SMILING (Улыбка) ===== */

/* Front image on Stage 8 - уменьшаем до 1.0 размера */
.front-image.stage8 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 8 with .moved class - пропорциональное уменьшение */
.front-image.stage8.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Smile image for Stage 8 */
.smile-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Smile image on Stage 8 - базовый размер для Stage 8 */
.smile-image.stage8 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Smile image on Stage 8 with .moved class - пропорциональное уменьшение */
.smile-image.stage8.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* ===== STAGE 9: TONGUE OUT (Язык) ===== */

/* Front image on Stage 9 - уменьшаем до 1.0 размера */
.front-image.stage9 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 9 with .moved class - пропорциональное уменьшение */
.front-image.stage9.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* Tongue image for Stage 9 */
.tongue-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
    z-index: 11;
    pointer-events: none;
    user-select: none;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Tongue image on Stage 9 - базовый размер для Stage 9 */
.tongue-image.stage9 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Tongue image on Stage 9 with .moved class - пропорциональное уменьшение */
.tongue-image.stage9.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.4) !important;
}

/* ===== STAGE 10: DIGITS (Произнесение цифр) ===== */

/* Front image on Stage 10 - уменьшаем до 1.0 размера */
.front-image.stage10 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1.0);
}

/* Front image on Stage 10 with .moved class - пропорциональное уменьшение */
.front-image.stage10.moved {
    top: auto !important;
    bottom: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.5) !important;
}

/* Стили для подсвечивания цифр */
.digit-highlight {
    color: #00ff00;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.8);
}

/* ===== ANIMATIONS ===== */
@keyframes blinking {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Анимация мигания для Stage 2 оверлеев (2 сек цикл) */
@keyframes blinking-stage2 {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Анимация мигания для Stage 4 оверлеев (500ms цикл - в 4 раза быстрее) */
@keyframes blinking-stage4 {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Анимация мигания для Stage 5 оверлеев (250ms цикл - в 8 раз быстрее чем Stage 3) */
@keyframes blinking-stage5 {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Stage 6 overlays с миганием (после нажатия GO) - просто показываются переклю через JS */
.stage6-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Face overlay с миганием (до нажатия GO) */
.face-overlay.blinking {
    animation: blinking 0.6s infinite;
}

/* Face overlay - blinking version (Stage 1, before GO) */
.face-overlay-blink {
    display: none !important;
}

/* Face overlay - blinking version (Stage 1, after START) - мигает 1 сек */
.face-overlay-blink.active {
    display: block !important;
    animation: blinking 1s infinite;
    visibility: visible !important;
}

/* Face overlay - static version (Stage 1, after GO) */
.face-overlay-static {
    animation: none;
}

/* Stage 2 overlays с миганием (после нажатия GO) */
.stage2-overlay.active {
    display: block !important;
    animation: blinking-stage2 2s infinite;
}

/* Stage 3 overlays с миганием (после нажатия GO) */
.stage3-overlay.active {
    display: block !important;
    animation: blinking-stage2 2s infinite;
}

/* Stage 4 overlays с миганием (после нажатия GO) - в 4 раза быстрее (500ms цикл) */
.stage4-overlay.active {
    display: block !important;
    animation: blinking-stage4 500ms infinite;
}

/* Stage 5 overlays с миганием (после нажатия GO) - в 8 раз быстрее (250ms цикл) */
.stage5-overlay.active {
    display: block !important;
    animation: blinking-stage5 250ms infinite;
}

/* Stage 7 overlay (appear only after GO button on Stage 7) */
.stage7-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Stage 8 overlay (appear only after GO button on Stage 8) */
.stage8-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Stage 9 overlay (appear only after GO button on Stage 9) */
.stage9-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Stage 10 overlay (appear only after GO button on Stage 10) */
.stage10-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Stage 12 overlay (appear only after GO button on Stage 12) */
.stage12-overlay.active {
    display: block !important;
    opacity: 1;
}

/* Кнопка START (белая прямоугольная) */
.record-btn {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 50px;
    border-radius: 8px;
    background: #ffffff;
    border: none;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.record-btn:hover {
    transform: translateX(-50%) scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
}

.record-btn:active {
    transform: translateX(-50%) scale(0.95);
}

.record-btn.recording {
    background: #f0f0f0;
}

/* Индикатор состояния записи - скрыт */
.recording-indicator {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 59, 48, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    display: none !important;
    z-index: 30;
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s ease;
}

.recording-indicator.active {
    display: none !important;
    gap: 10px;
    align-items: center;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#timer {
    font-variant-numeric: tabular-nums;
    min-width: 50px;
}

/* Сообщение о приватности */
.privacy-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    z-index: 15;
    max-width: 60%;
    min-width: 320px;
    backdrop-filter: blur(10px);
    display: none;
}

/* Stage 11: поднимаем инструкцию повыше */
.document-screen #documentInstruction {
    top: 10px !important;
}

/* Адаптация для мобильных устройств */
@media (max-height: 600px) {
    .container {
        max-width: 100%;
        aspect-ratio: auto;
    }

    .record-btn {
        bottom: 20px;
        width: 90px;
        height: 90px;
        font-size: 12px;
    }

    .privacy-message {
        font-size: 11px;
        padding: 10px 20px;
        min-width: auto;
        max-width: 90%;
    }

    .recording-indicator {
        font-size: 14px;
        padding: 8px 15px;
    }
}

/* Адаптация для ландшафтной ориентации */
@media (orientation: landscape) {
    .container {
        aspect-ratio: 16 / 9;
        max-width: 90vw;
        max-height: 90vh;
    }

    .overlay-frame {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
}

/* ===== LANGUAGE SELECTION SCREEN ===== */

.language-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 40px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.language-screen.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.language-screen:not(.active) {
    display: none;
}

.language-title {
    color: white;
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
}

.language-buttons {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border: 2px solid white;
    background: transparent;
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 160px;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.lang-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.2);
}

/* Main screen - скрыта по умолчанию */
.main-screen {
    display: none;
    width: 100%;
    height: 100%;
    z-index: 100;
}

.main-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Document screen - скрыта по умолчанию */
.document-screen {
    display: none;
    width: 100%;
    height: 100%;
    z-index: 100;
}

.document-screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Document layer overlay - должна быть видна только при съёмке документа */
.document-overlay {
    display: none !important;
}

.document-overlay.active {
    display: block !important;
}

/* Document select buttons - кнопки выбора типа документа (в центре) */
.document-select-buttons {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 200px;
    z-index: 20;
}

.doc-type-btn {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    background: #ffffff;
    border: none;
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.doc-type-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
}

.doc-type-btn:active {
    transform: scale(0.95);
}

.doc-type-btn.hidden {
    display: none;
}

/* Document capture buttons - кнопки съёмки документа */
.document-capture-buttons {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

/* Кнопка GO для Passport опускается ниже чтобы не перекрывалась с оверлеем */
#docGoBtn.passport-button {
    bottom: 10px !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
}

/* Completion screen - экран завершения верификации */
.complete-screen {
    display: none;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.complete-screen.active {
    display: flex;
}

.completion-content {
    text-align: center;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 40px 20px;
    gap: 0;
}

.completion-logo {
    width: auto;
    height: 280px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 20px;
}

.completion-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.completion-content button {
    flex-shrink: 0;
}

.completion-content p {
    font-size: 18px;
    margin: 0;
    opacity: 0.9;
}

/* Cryptobox Modal */
.cryptobox-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.cryptobox-content {
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 3px solid #667eea;
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 350px;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#cryptoboxReward {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 100%;
}

.crypto-reward-amount {
    font-size: clamp(18px, 5vw, 32px);
    font-weight: 600;
    color: #667eea;
    letter-spacing: 0.3px;
    font-family: 'Courier New', monospace;
    line-height: 1.1;
    margin: 0;
}

.crypto-reward-symbol {
    font-size: clamp(24px, 7vw, 48px);
    font-weight: 800;
    color: #667eea;
    letter-spacing: 1px;
    font-family: 'Arial', 'Helvetica', sans-serif;
    line-height: 1.1;
    margin: 0;
    text-transform: uppercase;
}

.cryptobox-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 32px;
    color: #667eea;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.cryptobox-close:hover {
    transform: scale(1.2);
    color: #764ba2;
}

.cryptobox-close:active {
    transform: scale(0.9);
}
