* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    
    /* === БЛОКИРОВКА ВЫДЕЛЕНИЯ И СИСТЕМНЫХ МЕНЮ (ДЛЯ iOS/Android) === */
    -webkit-touch-callout: none; /* Блокирует контекстное меню на iOS */
    -webkit-user-select: none;   /* Safari / iOS Safari */
    -khtml-user-select: none;    /* Konqueror HTML */
    -moz-user-select: none;      /* Firefox */
    -ms-user-select: none;       /* Internet Explorer/Edge */
    user-select: none;           /* Глобальная блокировка выделения текста */
    -webkit-tap-highlight-color: transparent; /* Убирает синее выделение при тапе на Android */
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background-color: #1a1a1a; /* Цвет «ушей» по бокам, если экран очень широкий */
    margin: 0;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #1a252f;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
}

#start-screen h1 {
    font-size: 50px;
    margin-bottom: 20px;
    text-align: center;
    
    /* === ЗОЛОТОЙ СТИЛЬ И ОКАНТОВКА === */
    color: #ffd700; /* Яркий золотой цвет */
    -webkit-text-stroke: 4px #000; /* Жирная черная окантовка */
    
    /* Двойная тень: первая делает жесткий черный объем (3D эффект), вторая дает легкое свечение */
    text-shadow: 6px 6px 0px #000, 0 0 20px rgba(255, 215, 0, 0.6);
    
    letter-spacing: 2px; /* Чуть раздвинем буквы для солидности */
}

#start-btn {
    padding: 15px 40px;
    font-size: 1.5rem;
    background: #2ecc71;
    color: white;
    border: 3px solid #27ae60;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s;
}

#start-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

/* Стили для заблокированной кнопки во время загрузки Яндекс SDK */
#start-btn:disabled {
    background: #95a5a6;
    border-color: #7f8c8d;
    cursor: not-allowed;
    transform: none;
}

#game-container {
    width: 1280px; /* Это оставляем как базовый размер для расчетов */
    height: 720px;
    position: relative; /* Убираем absolute, если хотим центрировать через flex тела */
    transform-origin: center center; 
    border: 4px solid #1a252f;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
    background-size: cover;
    background-position: center;
    overflow: hidden; /* Чтобы элементы интерфейса не вылезали за края */
}

#mute-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s;
}

#mute-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

#ui-layer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7)); /* Затемнение внизу для читаемости */
}

#dialog-box {
    background: rgba(255, 255, 255, 0.95);
    border: 4px solid #8e44ad;
    border-radius: 15px;
    padding: 20px;
    position: relative;
    min-height: 120px;
    cursor: pointer; /* Показывает, что можно кликнуть */
}

#speaker-name {
    position: absolute;
    top: -20px;
    left: 20px;
    background: #8e44ad;
    color: white;
    padding: 5px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    border: 3px solid white;
}

#dialog-text {
    font-size: 1.3rem;
    color: #333;
    line-height: 1.4;
    margin-top: 10px;
    white-space: pre-wrap; /* Сохраняет пробелы и переносит текст */
    word-wrap: break-word; /* Переносит слишком длинные слова */
}

#choices-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.choice-btn {
    background: #f39c12;
    color: white;
    border: 3px solid #d35400;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    text-shadow: 1px 1px 0px #000;
}

.choice-btn:hover {
    background: #e67e22;
    transform: scale(1.02);
}

.choice-btn:active {
    transform: scale(0.98);
}

/* Игровой контейнер остается жесткого размера для правильного скейлинга */
#game-container {
    width: 1280px;
    height: 720px;
    position: absolute; 
    transform-origin: center center; 
    border: 4px solid #1a252f;
    box-shadow: 0 0 30px rgba(0,0,0,0.9);
}

/* А стартовый экран делаем на 100% ширины и высоты браузера */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;  /* 100% ширины экрана */
    height: 100vh; /* 100% высоты экрана */
    
    background-image: url('images/bg.jpeg');
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    background-color: #1a252f; 
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: white;
    
    /* Самая важная строчка: запрещаем скрипту сжимать стартовое окно! */
    transform: none !important; 
}

/* === СТИЛИ МИНИ-ИГРЫ === */
#minigame-ui {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 50;
}

#progress-bar-container {
    width: 100%;
    height: 50px;
    background: rgba(0,0,0,0.7);
    border: 6px solid #fff;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 0 20px #e74c3c;
}

#progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e74c3c);
    transition: width 0.1s ease-out; /* Плавное заполнение */
}

#minigame-text {
    font-size: 50px;
    color: white;
    font-weight: bold;
    text-shadow: 4px 4px 0 #000;
    margin-top: 15px;
    animation: pulse 0.4s infinite alternate;
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.1); color: #f1c40f; }
}