﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f0f0f0;
    color: #333;
    line-height: 1.6;
    transition: background-color 0.5s ease;
}

#game-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    min-height: 500px;
}

.screen {
    display: none;
}

.screen.active {
    display: block;
}

#auth-screen {
    text-align: center;
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

button {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

.error {
    color: #e74c3c;
    margin-top: 10px;
}

#game-screen {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: 60px; /* Место для элементов управления */
}

#slide-content {
    flex: 1;
    position: relative;
    margin-right: 240px; /* Место для артефактов */
    transition: margin-right 0.3s ease;
}

#media-container {
    margin-bottom: 20px;
    text-align: center;
}

#media-container img,
#media-container video {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
}

#text-container {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    font-size: 18px;
    line-height: 1.6;
}

#slide-number {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 5px 0 0 0;
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.choice-button {
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.3s;
}

.choice-button:hover {
    background-color: #2980b9;
}

.choice-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.back-button {
    background-color: #e74c3c;
}

.back-button:hover {
    background-color: #c0392b;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 10px;
        background-color: white;
    }
    
    #game-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 15px;
        border-radius: 0;
        box-shadow: none;
        min-height: 100vh;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    .input-group {
        margin-bottom: 12px;
    }
    
    input {
        padding: 12px;
        font-size: 16px; /* Увеличиваем для удобства на мобильных */
    }
    
    button {
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        margin-bottom: 10px;
    }
    
    #game-screen {
        padding: 10px 0;
        padding-top: 20px;
    }
    
    #media-container img,
    #media-container video {
        max-height: 200px;
        margin: 0 auto;
    }
    
    #text-container {
        font-size: 16px;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    #choices-container {
        gap: 8px;
    }
    
    .choice-button {
        padding: 15px;
        font-size: 16px;
    }
    
    #slide-number {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    body {
        font-size: 13px;
        padding: 5px;
    }
    
    #game-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    #media-container img,
    #media-container video {
        max-height: 150px;
    }
    
    #text-container {
        font-size: 15px;
        padding: 10px;
    }
    
    .choice-button {
        padding: 12px;
        font-size: 15px;
    }
}

/* Для планшетов */
@media (min-width: 769px) and (max-width: 1024px) {
    #game-container {
        max-width: 90%;
        margin: 20px auto;
    }
    
    #media-container img,
    #media-container video {
        max-height: 250px;
    }
}

/* Улучшения для десктопов */
@media (min-width: 1025px) {
    body {
        padding: 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        min-height: 100vh;
    }
    
    #game-container {
        margin: 30px auto;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }
}

/* Улучшения для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .choice-button {
        min-height: 50px;
        display: flex;
        align-items: center;
    }
    
    button {
        min-height: 44px; /* Минимальный размер для удобного касания */
    }
    
    input {
        min-height: 44px;
    }
}

/* Предотвращение масштабирования при фокусе на iOS */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important; /* Предотвращает масштабирование в iOS */
    }
}

/* Улучшенная поддержка темной темы */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }
    
    #game-container {
        background-color: #2d2d2d;
        color: #ffffff;
    }
    
    input {
        background-color: #3d3d3d;
        color: #ffffff;
        border-color: #555;
    }
    
    #text-container {
        background-color: #3d3d3d;
        color: #ffffff;
    }
}

/* Анимации для улучшения UX */
.screen {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.screen.active {
    opacity: 1;
    transform: translateY(0);
}

/* Улучшенная доступность */
button:focus,
input:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Предотвращение выделения текста на кнопках */
button {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Стили для интерфейса артефактов */
#player-ui {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 50; /* Ниже основного контента */
    max-width: 220px;
    border: 1px solid #ddd;
    max-height: 250px;
    overflow-y: auto;
}

#artifacts-container h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

#artifacts-list {
    max-height: 200px;
    overflow-y: auto;
}

.artifact-item {
    padding: 8px 12px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    font-size: 13px;
    display: flex;
    justify-content: between;
    align-items: center;
}

.artifact-item .artifact-name {
    flex: 1;
}

.artifact-item .artifact-remove {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 11px;
}

.artifact-item .artifact-remove:hover {
    background: #c0392b;
}

/* Адаптивность для мобильных */
/* На мобильных убираем боковое меню */
@media (max-width: 768px) {
    #player-ui {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
        max-height: 150px;
    }
    
    #slide-content {
        margin-right: 0;
    }
}

/* Стили для управления интерфейсом */
#ui-controls {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 10px;
    z-index: 60;
}

#ui-controls button {
    padding: 8px 12px;
    background-color: #34495e;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

#ui-controls button:hover {
    background-color: #2c3e50;
}

/* Панель для дополнительной картинки */
.image-panel {
    position: absolute;
    top: 50px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 55;
    max-width: 200px;
    border: 1px solid #ddd;
}

.image-panel img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 5px;
    display: none;
}

/* Состояния скрытия */
.artifacts-hidden #player-ui {
    display: none;
}

.artifacts-hidden #slide-content {
    margin-right: 0;
}

.choices-hidden .choice-button:disabled {
    display: none;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    #ui-controls {
        position: relative;
        top: auto;
        left: auto;
        justify-content: center;
        margin-bottom: 10px;
        flex-wrap: wrap;
    }
    
    .image-panel {
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        max-width: 100%;
        margin-bottom: 15px;
    }
    
    #game-screen {
        padding-top: 20px;
    }
    
    #slide-content {
        margin-right: 0;
    }
    
    #ui-controls button {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    #ui-controls {
        flex-direction: column;
        align-items: center;
    }
    
    #ui-controls button {
        width: 100%;
        margin-bottom: 5px;
    }
}

/* Стили для картинки на экране авторизации */
.auth-image-container {
    text-align: center;
    margin-bottom: 20px;
    max-height: 200px;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#auth-image {
    max-width: 100%;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
}

/* Скрытие картинки при переходе к игре */
#game-screen.active ~ #auth-image-container,
#game-screen.active ~ #auth-image {
    display: none;
}

/* Альтернативный способ скрытия через JavaScript */
.auth-image-hidden {
    display: none !important;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {
    .auth-image-container {
        max-height: 150px;
        margin-bottom: 15px;
    }
    
    #auth-image {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .auth-image-container {
        max-height: 120px;
        margin-bottom: 10px;
    }
    
    #auth-image {
        max-height: 120px;
    }
}

/* Базовые стили для кнопок обратной связи - КРУГЛЫЕ ИКОНКИ */
.callback-button {
    position: fixed;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    text-decoration: none;
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out;
}

.callback-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.callback-button:active {
    transform: translateY(0);
}

/* Скрываем текстовые метки */
.button-text {
    display: none !important;
}

/* Стили для иконок */
.callback-button img {
    width: 100%;
    height: 100%;
    padding: 8px;
    box-sizing: border-box;
    filter: brightness(0) invert(1); /* Делаем иконки белыми */
}

/* WhatsApp кнопка */
.whatsapp-button {
    bottom: 100px;
    width: 60px;
    height: 60px;
    background: #25D366;
}

.whatsapp-button:hover {
    background: #20bd5c;
}

/* Telegram кнопка */
.telegram-button {
    bottom: 180px;
    width: 60px;
    height: 60px;
    background: #0088cc;
}

.telegram-button:hover {
    background: #0077b3;
}

/* Адаптация для мобильных устройств */
@media (max-width: 768px) {
    .callback-button {
        right: 15px;
    }
    
    .whatsapp-button {
        bottom: 90px;
        width: 50px;
        height: 50px;
    }
    
    .telegram-button {
        bottom: 155px;
        width: 50px;
        height: 50px;
    }
    
    .callback-button img {
        padding: 6px;
    }
}

/* Для очень маленьких экранов */
@media (max-width: 480px) {
    .callback-button {
        right: 10px;
    }
    
    .whatsapp-button {
        bottom: 80px;
        width: 45px;
        height: 45px;
    }
    
    .telegram-button {
        bottom: 140px;
        width: 45px;
        height: 45px;
    }
    
    .callback-button img {
        padding: 5px;
    }
}

/* Для ультра-маленьких экранов (например, iPhone SE) */
@media (max-width: 320px) {
    .whatsapp-button {
        width: 40px;
        height: 40px;
        bottom: 70px;
    }
    
    .telegram-button {
        width: 40px;
        height: 40px;
        bottom: 125px;
    }
    
    .callback-button img {
        padding: 4px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 400px) and (orientation: landscape) {
    .whatsapp-button {
        bottom: 15px;
        width: 40px;
        height: 40px;
    }
    
    .telegram-button {
        bottom: 65px;
        width: 40px;
        height: 40px;
    }
    
    .callback-button img {
        padding: 4px;
    }
}

/* Улучшение для touch-устройств */
@media (hover: none) and (pointer: coarse) {
    .callback-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Предотвращение выделения на кнопках */
.callback-button {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* Анимации для кнопок обратной связи */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

        /* Стили для Яндекс.Метрики */
        #yandex-metrika-container:hover {
            opacity: 1;
        }

        /* Адаптивность для мобильных */
        @media (max-width: 768px) {
            #yandex-metrika-container {
                bottom: 5px !important;
                left: 5px !important;
            }
            
            #yandex-metrika-container img {
                width: 70px !important;
                height: 25px !important;
            }
        }

        /* Для очень маленьких экранов */
        @media (max-width: 480px) {
            #yandex-metrika-container {
                bottom: 3px !important;
                left: 3px !important;
            }
            
            #yandex-metrika-container img {
                width: 60px !important;
                height: 21px !important;
            }
        }
