body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

#container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

#controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 20px;
    z-index: 1000;
}
#controls-scene2 {
    position: fixed;
    bottom: 20px;
    left: 50%;
    font-size: 24px;
    transform: translateX(-50%);
    display: none;
    gap: 20px;
    z-index: 1000;
}

.control-button {
    padding: 15px 30px;
    font-size: 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-button:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.control-button:active {
    transform: translateY(0);
}

#goodButton, #soft {
    background-color: #4CAF50;
    color: white;
}

#toxicButton, #tense {
    background-color: #f44336;
    color: white;
}

#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: white;
    font-family: sans-serif;
}

.loader-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4376d6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.controls-hint {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

.hint-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-family: sans-serif;
    font-size: 14px;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.hint-gif {
    width: 80px;
    /* Настройте размер под ваши гифки */
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

#overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#card-content:hover {
    transform: translateY(-10px) rotate(1deg) !important;
}

#card-overlay {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


#startButtonScene1 {
    margin: 10px;
    padding: 20px 40px;
    font-size: 20px;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}
#startButtonScene2 {
    margin: 10px;
    padding: 20px 40px;
    font-size: 20px;
    background: linear-gradient(45deg, #3498db, #9b59b6);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}


.world-label {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    border-radius: 12px;
    pointer-events: none;
    user-select: none;
    white-space: nowrap;
    color: #ffffff;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8); /* Чуть плотнее для читаемости */

    backdrop-filter: blur(5px); /* Эффект матового стекла для красоты */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    font-size: clamp(1rem, 2.5vw, 2rem); 
    line-height: 1.4;
}

#startButton:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(52, 152, 219, 0.4);
}

.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.control-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

#subtitle-container {
    position: absolute;
    bottom: 8%; /* Чуть ниже для лучшего обзора сцены */
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.8); /* Чуть плотнее для читаемости */
    padding: 15px 25px;
    border-radius: 12px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    
    /* Адаптивный шрифт: минимум 16px, оптимально 2.5% ширины экрана, максимум 32px */
    font-size: clamp(1rem, 2.5vw, 2rem); 
    line-height: 1.4;
    
    width: auto;
    max-width: 85%;
    min-width: 280px; /* Чтобы контейнер не схлопывался на коротких словах */
    
    text-align: center;
    display: none;
    pointer-events: none;
    z-index: 1000;

    backdrop-filter: blur(5px); /* Эффект матового стекла для красоты */
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#cctvButton {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.hint-bulb {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2000;
    font-size: 24px;
    border: 2px solid gold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transition: transform 0.3s ease;
}

.hint-bulb:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.4);
}

.hint-bubble {
    position: fixed;
    top: 80px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2000;
    font-weight: bold;
    max-width: 200px;
    text-align: center;
}


.control-button {
    padding: 18px 35px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}


.control-button:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.control-button:active:not(:disabled) {
    transform: translateY(-1px);
    border-bottom: 2px solid transparent;
}
/* Контейнер финального выбора */
#final-choice-overlay {
    display: none; 
    flex-direction: column; 
    position: fixed; 
    top: 50%; 
    left: 50%; 
    transform: translate(-50%, -50%); 
    
    /* Эффект матового стекла (как у твоих лейблов) */
    background: rgba(0, 0, 0, 0.85); 
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    padding: 40px; 
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    
    color: white;
    text-align: center;
    z-index: 10000; /* Самый высокий приоритет */
    min-width: 320px;
    gap: 12px;
    animation: fadeIn 0.5s ease-out;
}

#final-choice-overlay h3 {
    margin-top: 0;
    margin-bottom: 25px;
    font-family: 'Segoe UI', sans-serif;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffd700; /* Золотистый цвет для заголовка */
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* Кнопки подозреваемых */
.culprit-btn {
    padding: 15px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.culprit-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Выделение кнопки "Начальник" (самообвинение) */
.culprit-btn[data-name="Начальник"] {
    margin-top: 10px;
    background: linear-gradient(45deg, #2c3e50, #000000);
    border: 1px solid #ffd700;
    color: #ffd700;
}

.culprit-btn[data-name="Начальник"]:hover {
    background: linear-gradient(45deg, #34495e, #1a1a1a);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
}

/* Адаптация для мобилок */
@media (max-width: 600px) {
    #final-choice-overlay {
        width: 85%;
        padding: 25px 15px;
    }
    
    .culprit-btn {
        padding: 12px 15px;
        font-size: 1rem;
    }
}

/* Кнопка CCTV в стиле вашей лампочки/оверлея */
#cctvButton {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 15px 30px;
    background: linear-gradient(45deg, #f39c12, #d35400);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px; /* Овальная форма */
    font-weight: 800;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 0 20px rgba(243, 156, 18, 0.5);
    backdrop-filter: blur(5px);
}

#video-controls {
    position: fixed;
    bottom: 30px; /* Отступ снизу */
    left: 50%;
    transform: translateX(-50%); /* Центрирование */
    display: none;
    gap: 10px;
    z-index: 3000;
}
.control-button-player {
    color: #ffffff;
    padding: 5% 10% 5% 10%;

    font-size: 24px;
    border-radius: 12px;
    background-color: rgba(0,0,0,0.75);;
    gap: 20px;

}

.accusation-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.164); z-index: 9999;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.accusation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 40px; }
.culprit-card { 
    padding: 20px; background: rgba(255,255,255,0.1); color: white; 
    border: 1px solid white; cursor: pointer; border-radius: 10px; 
}
.culprit-card:hover { background: white; color: black; }
/* Анимация пульсации для привлечения внимания */
@keyframes bulb-glow {
    0% { box-shadow: 0 0 5px gold; }
    50% { box-shadow: 0 0 20px gold; }
    100% { box-shadow: 0 0 5px gold; }
}
.hint-bulb { animation: bulb-glow 2s infinite; }

/* Специфичные правки для мобильных устройств в портретном режиме */
@media (max-width: 600px) and (orientation: portrait) {
    #subtitle-container {
        bottom: 15%; /* Поднимаем выше, чтобы не перекрывалось пальцами/интерфейсом */
        width: 90%;
        padding: 12px 18px;
        font-size: 1.1rem; /* Фиксированный размер для очень маленьких экранов */
    }
}

/* --- Оверлей и модальное окно для Изучения Досье --- */
#dossier-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.dossier-close-btn {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 5004;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.8);
    font-size: 15px;
    cursor: pointer;
}

.dossier-close-btn:hover { background: rgba(255, 255, 255, 0.2); }
.dossier-close-btn span { font-size: 13px; }

.dossier-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 94vw;
    max-height: 88vh;
}

/* Контейнер под вертикальные фото для нормального отображения на горизонтальном экране */
.dossier-photo-wrapper {
    width: min(92vw, 1100px);
    height: min(68vh, 780px);
    max-width: 94vw;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.dossier-photo-wrapper img {
    height: 100%;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
}

#dossier-overlay.is-zoomed .dossier-photo-wrapper {
    position: fixed;
    inset: 12px;
    z-index: 5001;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.96);
    box-shadow: none;
}

#dossier-overlay.is-zoomed .dossier-photo-wrapper img {
    width: auto;
    height: auto;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    cursor: zoom-out;
}

/* Кнопки переключения «Предыдущий» / «Следующий» */
.dossier-controls {
    position: relative;
    z-index: 5003;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

#dossier-overlay.is-zoomed .dossier-controls {
    position: fixed;
    left: 50%;
    bottom: 14px;
    margin: 0;
    transform: translateX(-50%);
}

.dossier-btn {
    padding: 12px 24px;
    font-size: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dossier-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.dossier-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .dossier-close-btn { top: 10px; right: 10px; padding: 7px 10px; }
    .dossier-close-btn span { font-size: 12px; }
    .dossier-photo-wrapper { width: 96vw; height: 62vh; padding: 6px; }
    .dossier-controls { gap: 8px; margin-top: 10px; }
    .dossier-btn { padding: 10px 13px; font-size: 15px; }
    #dossier-overlay.is-zoomed .dossier-photo-wrapper { inset: 8px; }
    #dossier-overlay.is-zoomed .dossier-photo-wrapper img { max-width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
    #dossier-overlay.is-zoomed .dossier-controls { bottom: 10px; width: calc(100% - 20px); }
}
