@font-face {
    font-family: 'MyCustomFont';
    src: url('../assets/MyCustomFont.otf') format('truetype'); 
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'MyCustomFont'; 

}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'MyCustomFont', sans-serif; 
    background-color: #000000; 
    color: #ffffff;
    overflow: hidden; 
    user-select: none;
    height: 100vh;
    width: 100vw;
}


.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000; 
}

.preloader.hidden {
    display: none; 
}

.preloader h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #8a2be2; 
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.7);
}

.loading-bar {
    width: 80%;
    max-width: 400px;
    height: 20px;
    background-color: #333;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #8a2be2;
}

#loading-progress {
    height: 100%;
    width: 0%;
    background-color: #8a2be2;
    transition: width 0.3s ease;
    background: linear-gradient(90deg, #8a2be2, #00ffff); 
}

#loading-text {
    font-size: 1rem;
    color: #aaa;
}


.game-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.game-container.hidden {
    display: none;
}


.top-bar {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid #8a2be2;
    z-index: 100;
}

.resource {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px; 
}

.resource-icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.resource-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ffff; 
}

.energy-bar {
    width: 100%;
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
    border: 1px solid #555;
}

.energy-fill {
    height: 100%;
    width: 100%; /* Будет управляться JS */
    background-color: #8a2be2; /* Фиолетовый для энергии */
    transition: width 0.3s ease;
}

.passive-income {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: #00ff00; /* Зеленый для пассивного дохода */
}

/* Центральная игровая область */
.game-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background-color: #111; /* Темный фон */
}

.location-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.8; /* Чтобы персонаж был виден поверх */
    transition: background-image 0.5s ease; /* Плавный переход фона */
}

.mel-character {
    position: absolute;
    /* Располагаем над нижней панелью. bottom = высота панели (примерно 80px) */
    bottom: 0px; /* Высота нижней панели */
    left: 10px; /* Прижимаем к левому краю */
    z-index: 50;
    /* Добавим отрицательный margin-top, чтобы "вогнать" Мела вниз, за нижнюю границу */
    /* Это создаст эффект, что его нижняя часть заходит за панель */
    margin-bottom: -20px; /* Примерно на 20px заходит за нижнюю границу */
}

.mel-character img {
    max-width: 400px; /* Увеличенный размер */
    max-height: 600px; /* Увеличенный размер */
    width: auto;
    height: auto;
    cursor: pointer; /* Меняет курсор при наведении */
    transition: transform 0.1s ease; /* Анимация при клике */
}

.mel-character img:active {
    transform: scale(0.95); /* Небольшое сжатие при нажатии */
}

/* Нижняя панель действий */
.bottom-bar {
    display: flex;
    justify-content: space-around;
    padding: 15px 10px;
    background-color: rgba(0, 0, 0, 0.7);
    border-top: 1px solid #8a2be2;
    gap: 10px; /* Расстояние между кнопками */
    position: relative; /* Убедимся, что z-index работает относительно этого */
    z-index: 60; /* Выше фона, но ниже уведомлений и меню */
}

.action-btn, .nav-btn {
    padding: 12px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: bold;
    min-width: 100px; /* Минимальная ширина для удобства */
}

.action-btn {
    background-color: #8a2be2; /* Фиолетовый для основного действия */
    color: white;
}

.action-btn:hover {
    background-color: #7a1bd2;
    transform: scale(1.05);
}

.action-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
}

.nav-btn {
    background-color: #333;
    color: #ddd;
    border: 1px solid #8a2be2;
}

.nav-btn:hover {
    background-color: #444;
    transform: scale(1.05);
}

/* Общий стиль для меню */
.menu {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background-color: rgba(0, 0, 0, 0.95);
    border: 2px solid #8a2be2;
    border-radius: 10px;
    padding: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Для скрытия полосы прокрутки, если не нужна */
}

.menu.hidden {
    display: none;
}

.menu h2 {
    color: #00ffff;
    margin-bottom: 15px;
    text-align: center;
    text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

.close-btn, .buy-btn {
    padding: 10px 15px;
    margin-top: 15px;
    align-self: flex-end;
    background-color: #8a2be2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.close-btn:hover, .buy-btn:hover {
    background-color: #7a1bd2;
}

.upgrades-list, .team-list, .achievements-list, .events-list, .prestige-list { /* Добавлен .prestige-list */
    overflow-y: auto; /* Добавляет полосу прокрутки, если контент длинный */
    flex: 1;
    padding-right: 5px; /* Маленький отступ для полосы прокрутки */
}

.upgrades-list::-webkit-scrollbar, .team-list::-webkit-scrollbar, .achievements-list::-webkit-scrollbar, .events-list::-webkit-scrollbar, .prestige-list::-webkit-scrollbar { /* Добавлен .prestige-list */
    width: 8px;
}

.upgrades-list::-webkit-scrollbar-track, .team-list::-webkit-scrollbar-track, .achievements-list::-webkit-scrollbar-track, .events-list::-webkit-scrollbar-track, .prestige-list::-webkit-scrollbar-track { /* Добавлен .prestige-list */
    background: #333;
    border-radius: 4px;
}

.upgrades-list::-webkit-scrollbar-thumb, .team-list::-webkit-scrollbar-thumb, .achievements-list::-webkit-scrollbar-thumb, .events-list::-webkit-scrollbar-thumb, .prestige-list::-webkit-scrollbar-thumb { /* Добавлен .prestige-list */
    background: #8a2be2;
    border-radius: 4px;
}

.upgrade-item, .team-item, .achievement-item, .event-item, .prestige-item, .luxury-item { /* Добавлены .prestige-item, .luxury-item */
    padding: 10px;
    margin: 10px 0;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upgrade-item.locked, .team-item.locked, .achievement-item.locked, .event-item.locked, .prestige-item.locked, .luxury-item.locked { /* Добавлены .prestige-item.locked, .luxury-item.locked */
    opacity: 0.6;
    filter: grayscale(100%);
}

.upgrade-item.locked .buy-btn, .team-item.locked .buy-btn, .event-item.locked .event-btn, .prestige-item.locked .prestige-btn, .luxury-item.locked .luxury-btn { /* Добавлены .prestige-item.locked .prestige-btn, .luxury-item.locked .luxury-btn */
    background-color: #555;
    cursor: not-allowed;
}

.upgrade-item.locked .buy-btn:hover, .team-item.locked .buy-btn:hover, .event-item.locked .event-btn:hover, .prestige-item.locked .prestige-btn:hover, .luxury-item.locked .luxury-btn:hover { /* Добавлены .prestige-item.locked .prestige-btn:hover, .luxury-item.locked .luxury-btn:hover */
    background-color: #555;
}

.upgrade-name, .team-name, .achievement-name, .event-name, .prestige-name, .luxury-name { /* Добавлены .prestige-name, .luxury-name */
    flex: 1;
}

.upgrade-cost, .team-cost, .achievement-desc, .event-desc, .event-cost, .event-cooldown, .prestige-cost, .luxury-cost, .prestige-desc, .luxury-desc { /* Добавлены .prestige-..., .luxury-... */
    margin: 0 15px;
    color: #00ffff;
    font-weight: bold;
}

.upgrade-level, .team-status, .prestige-level, .luxury-level { /* Добавлены .prestige-level, .luxury-level */
    color: #aaa;
    font-size: 0.9rem;
}

.buy-btn, .event-btn, .prestige-btn, .luxury-btn { /* Добавлены .prestige-btn, .luxury-btn */
    min-width: 80px;
}

.setting-item {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.setting-item label {
    margin-bottom: 5px;
    color: #ddd;
}

.setting-item input[type="range"] {
    width: 100%;
}
/* Контейнер для уведомлений */
.notifications-container {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Расстояние между уведомлениями */
}

.notification {
    background-color: rgba(0, 0, 0, 0.85);
    border: 1px solid #8a2be2;
    border-radius: 8px;
    padding: 10px 15px;
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
    animation: fadeInOut 3s ease-in-out forwards; /* Анимация появления и исчезновения */
    word-wrap: break-word; /* Перенос слов при необходимости */
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(100%); }
    10% { opacity: 1; transform: translateX(0); }
    90% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(100%); }
}

.notification.donation {
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
    color: #00ff00;
}

/* Стили для меню престижа */
.prestige-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh; /* Ограничиваем высоту для прокрутки */
    overflow-y: auto; /* Добавляем прокрутку */
    padding-right: 10px; /* Отступ для полосы прокрутки */
}

.prestige-info, .prestige-item, .luxury-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.prestige-info h3 {
    color: gold;
    margin-bottom: 10px;
}

.prestige-info p, .prestige-desc, .luxury-desc {
    color: #ccc;
    font-size: 0.9rem;
    margin: 5px 0;
}

.prestige-name, .luxury-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00ffff;
    margin-bottom: 5px;
}

.prestige-cost, .luxury-cost {
    color: #00ff00;
    font-weight: bold;
    margin: 5px 0;
}

.prestige-level, .luxury-level {
    color: #aaa;
    font-size: 0.9rem;
}

.prestige-btn, .luxury-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #8a2be2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.prestige-btn:hover, .luxury-btn:hover {
    background-color: #7a1bd2;
}

.prestige-btn:disabled, .luxury-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
    opacity: 0.6;
}

.prestige-item.locked, .luxury-item.locked {
    opacity: 0.6;
}

/* Стили для кнопок переезда в меню мероприятий */
.move-buttons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.move-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.move-item .event-name {
    color: #ff6600; /* Оранжевый для переездов */
}

.move-item .event-desc {
    color: #ccc;
    font-size: 0.9rem;
    margin: 5px 0;
}

.move-btn {
    margin-top: 5px;
    padding: 6px 10px;
    background-color: #333;
    color: #ddd;
    border: 1px solid #ff6600;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 100%;
}

.move-btn:hover {
    background-color: #444;
}

.move-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #777;
}

.move-btn:disabled:hover {
    background-color: #555;
}

/* Стили для меню "Об игре" */
.about-game-content {
    text-align: left;
    line-height: 1.6;
    max-height: 60vh; /* Ограничиваем высоту для прокрутки */
    overflow-y: auto; /* Добавляем прокрутку */
    padding-right: 10px; /* Отступ для полосы прокрутки */
}

.about-game-content h3 {
    color: #00ffff;
    margin-top: 15px;
    margin-bottom: 10px;
}

.about-game-content ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.about-game-content li {
    margin-bottom: 8px;
}

.about-game-content strong {
    color: #8a2be2;
}

/* Прокрутка для всех списков */
.upgrades-list, .team-list, .achievements-list, .events-list, .prestige-list {
    max-height: 60vh; /* Ограничиваем высоту для прокрутки */
    overflow-y: auto; /* Добавляем прокрутку */
    padding-right: 10px; /* Отступ для полосы прокрутки */
}
/* ... (предыдущие стили) ... */

/* Стили для меню мероприятий */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 60vh; /* Ограничиваем высоту для прокрутки */
    overflow-y: auto; /* Добавляем прокрутку */
    padding-right: 10px; /* Отступ для полосы прокрутки */
}

.event-item {
    padding: 10px;
    margin: 10px 0;
    background-color: #222;
    border: 1px solid #444;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px; /* Отступ между элементами внутри */
}

.event-item.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.event-item.locked .event-btn {
    background-color: #555;
    cursor: not-allowed;
}

.event-item.locked .event-btn:hover {
    background-color: #555;
}

.event-name {
    flex: 1;
    font-weight: bold;
    color: #00ffff; /* Неоново-голубой, как в других элементах */
}

.event-desc {
    margin: 0 15px;
    color: #ccc; /* Светло-серый, как в других описаниях */
    font-size: 0.9rem;
}

.event-cost, .event-cooldown {
    margin: 0 15px;
    color: #00ff00; /* Зеленый, как в других затратах */
    font-weight: bold;
}

.event-btn {
    min-width: 80px;
    padding: 8px 12px;
    margin-top: 10px;
    align-self: flex-end;
    background-color: #8a2be2; /* Фиолетовый, как в других кнопках */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.event-btn:hover {
    background-color: #7a1bd2; /* Темнее фиолетовый при наведении */
}

.event-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
}

.event-btn:disabled:hover {
    background-color: #555;
}

/* Стили для кнопки проекта */
.project-btn {
    background-color: #00ff00; /* Зеленый */
    color: black;
    font-weight: bold;
    align-self: stretch; /* Растягиваем на всю ширину */
    margin-top: 5px; /* Небольшой отступ сверху */
}

.project-btn:hover {
    background-color: #00cc00; /* Темнее зеленый */
}

/* Стили для кнопок переезда */
.move-buttons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
    width: 100%; /* Занимаем всю ширину */
}

.move-item {
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.move-item .event-name {
    color: #ff00d4; /* Оранжевый для переездов */
}

.move-item .event-desc {
    color: #ccc;
    font-size: 0.9rem;
    margin: 5px 0;
}

.move-btn {
    margin-top: 5px;
    padding: 6px 10px;
    background-color: #333;
    color: #ddd;
    border: 1px solid #e100ff;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 100%; /* Занимаем всю ширину */
}

.move-btn:hover {
    background-color: #444;
}

.move-btn:disabled {
    background-color: #555;
    color: #aaa;
    cursor: not-allowed;
    opacity: 0.6;
    border-color: #777;
}

.move-btn:disabled:hover {
    background-color: #555;
}

/* ... (остальные стили) ... */

/* Прокрутка для всех списков */
.upgrades-list, .team-list, .achievements-list, .events-list, .prestige-list {
    max-height: 60vh; /* Ограничиваем высоту для прокрутки */
    overflow-y: auto; /* Добавляем прокрутку */
    padding-right: 10px; /* Отступ для полосы прокрутки */
}

.upgrades-list::-webkit-scrollbar, .team-list::-webkit-scrollbar, .achievements-list::-webkit-scrollbar, .events-list::-webkit-scrollbar, .prestige-list::-webkit-scrollbar {
    width: 8px;
}

.upgrades-list::-webkit-scrollbar-track, .team-list::-webkit-scrollbar-track, .achievements-list::-webkit-scrollbar-track, .events-list::-webkit-scrollbar-track, .prestige-list::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.upgrades-list::-webkit-scrollbar-thumb, .team-list::-webkit-scrollbar-thumb, .achievements-list::-webkit-scrollbar-thumb, .events-list::-webkit-scrollbar-thumb, .prestige-list::-webkit-scrollbar-thumb {
    background: #8a2be2;
    border-radius: 4px;
}

/* ... (остальные стили) ... */