* {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

body {
  touch-action: pan-x pan-y; /* разрешает только прокрутку по X и Y, но не зум */
}

    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        font-family: 'Keleti', Arial, sans-serif;
    }

    @font-face {
        font-family: 'Keleti';
        src: url('/Keleti-Regular.ttf') format('truetype');
        font-weight: normal;
        font-style: normal;
    }


#inventory-grid .inventory-item {
  cursor: pointer;
}

#inventory-grid .inventory-item.selected {
  border: 2px solid green;
}

#inventory-grid .inventory-item.equipped {
  border: 2px solid gold;
}

#item-details button {
  background-color: #555;
  color: white;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
}

#item-details button:hover {
  background-color: #777;
}





    #ui {
        position: absolute;
        top: 10px;
        left: 10px;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        background-image: url('/assets/panel.png');
        background-size: 100% 100%;
        padding: 20px;
        border-radius: 10px;
    }

    .bar-container {
            position: relative;
            width: 200px;  /* Consistent width for all progress bars */
            height: 20px;  /* Consistent height for all progress bars */
            background-color: #555;
            border: 1px solid #333;
            margin-bottom: 10px;
            border-radius: 10px; /* Uniform border radius */
            overflow: hidden; /* Avoid elements overflowing */
        }

        .bar-fill {
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            transition: width 0.3s ease; /* Smooth transition */
            border-radius: 10px;  /* Same border radius for the fill to match the container */
        }

        #health-text, #mana-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10; /* Ensure text is above the bar fill */
  color: #fff;
  font-size: 12px;
  text-shadow: 1px 1px 1px #000; /* Improve readability */
  pointer-events: none; /* Prevent text from interfering with clicks */
}

#gold-text {
  color: #ffd700; /* Gold color for visibility */
  font-size: 14px;
}

    #mana-bar .bar-fill {
      background-color: blue;
    }
    #health-bar .bar-fill {
      background-color: rgb(255, 0, 0);
    }

    button {
        background-image: url('/assets/button.png');
        background-size: 100% 100%;
        background-color: transparent;
        border: none;
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        margin: 10px 0;
        width: 100px;
        height: 50px;
        text-align: center;
        line-height: 25px;
        transition: background-color 0.3s ease;
    }

    button:hover {
        background-color: rgba(255, 255, 255, 0.6);
    }   
 

    #modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        justify-content: center;
        align-items: center;

        display: flex; 
    }

    #modal-content {
        background-image: url('/assets/panel.png');
        background-size: 100% 100%;
        padding: 20px;
        border-radius: 10px;
        color: white;
    }

    #modal-close {
        background-image: url('/assets/button.png');
        background-size: 100% 100%;
        background-color: transparent;
        border: none;
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        margin-top: 10px;
        width: 100px;
        height: 50px;
        text-align: center;
        line-height: 25px;
        transition: background-color 0.3s ease;
    }

    #modal-close:hover {
        background-color: rgba(255, 255, 255, 0.6);
    }

    #target-overlay {

    background-color: rgba(0, 0, 0, 0.9); 
    }

    #loading-modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1001; /* Высокий z-index, чтобы быть поверх всего */
    justify-content: center;
    align-items: center;
    pointer-events: all; /* Блокирует клики на других элементах */
}

#loading-content {
    background-image: url('/assets/panel.png');
    background-size: 100% 100%;
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    text-align: center;
    pointer-events: all; /* Разрешает клики внутри модального окна */
}

#loading-bar {
    position: relative;
    width: 300px;
    height: 20px;
    background-color: #555;
    border: 1px solid #333;
    border-radius: 10px;
    margin: 10px auto;
    overflow: hidden;
}

#loading-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: rgba(0, 128, 0, 0.7);
    width: 0%;
    transition: width 0.3s ease;
}

#play-button {
    display: none;
    background-image: url('/assets/button.png');
    background-size: 100% 100%;
    background-color: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    margin-top: 10px;
    width: 100px;
    height: 50px;
    text-align: center;
    line-height: 25px;
    transition: background-color 0.3s ease;
}

#play-button:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

/* Стили для модального окна квестов */
#quest-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

#quest-modal-content {
    background-image: url('/assets/panel.png');
    background-size: 100% 100%;
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    width: 600px;
    max-height: 80vh;
    box-sizing: border-box;
}

.quest-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px;
        margin-bottom: 10px;
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 5px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    }
    .quest-item:last-child {
        border-bottom: none;
    }
    .quest-level, .quest-name {
        font-size: 16px;
        color: rgb(236, 201, 3);
        font-family: 'Keleti', Arial, sans-serif;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 25px;
    }
    .quest-level {
        flex:0 0 100px;
        text-align: left;
    }
    .quest-name {
        flex: 1;
        margin: 0 10px;
        text-align: left;
    }
    .accept-quest-btn {
        background-image: url('/assets/button.png');
        background-size: 100% 100%;
        background-color: transparent;
        border: none;
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        width: 150px;
        height: 50px;
        text-align: center;
        line-height: 25px;
        transition: background-color 0.3s ease;
    }

    

.quest-item h3 {
    color: #ffcc00;
    margin-top: 0;
    margin-bottom: 10px;
}

.quest-item p {
    margin: 5px 0;
}

.accept-quest-btn {
    background-image: url('/assets/button.png');
    background-size: 100% 100%;
    background-color: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    border-radius: 5px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

#quest-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1002; /* Выше всех других модальных окон */
    justify-content: center;
    align-items: center;
}

#quest-detail-modal-content {
    background-image: url('/assets/panel.png');
    background-size: 100% 100%;
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    width: 600px;
    max-height: 80vh;
    box-sizing: border-box;
}

#quest-detail-content {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

#quest-detail-content h3 {
    color: #ffcc00;
    margin: 0 0 10px 0;
    font-size: 18px;
}

#quest-detail-content p {
    margin: 5px 0;
    font-size: 16px;
    line-height: 1.5;
}

#quest-detail-modal-close {
    background-image: url('/assets/button.png');
    background-size: 100% 100%;
    background-color: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    width: 150px;
    height: 50px;
    text-align: center;
    line-height: 25px;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

#quest-detail-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.accept-quest-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

 /* Стили для модального окна */
 #npc-modal {
            display: none; /* Важно: окно скрыто по умолчанию */
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        #npc-modal-content {
            background-image: url('/assets/panel.png');
            background-size: 100% 100%;
            padding: 20px;
            border-radius: 10px;
            color: white;
            font-family: 'Keleti', Arial, sans-serif;
            display: flex;
            flex-direction: column;
            width: 500px;
            height: 400px;
            box-sizing: border-box;
        }

        #npc-info {
            flex-grow: 1;
            overflow-y: auto;
            padding: 10px;
            border-radius: 5px;
            background-color: rgba(0, 0, 0, 0.5);
            margin-bottom: 10px;
            box-sizing: border-box;
        }

        #map-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    #map-modal-content {
        background-image: url('/assets/panel.png');
        background-size: 100% 100%;
        padding: 20px;
        border-radius: 10px;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 600px;
        height: 600px;
        box-sizing: border-box;
    }

    #map-modal-close {
        background-image: url('/assets/button.png');
        background-size: 100% 100%;
        background-color: transparent;
        border: none;
        padding: 10px 20px;
        font-size: 16px;
        cursor: pointer;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        width: 100px;
        height: 50px;
        text-align: center;
        line-height: 25px;
        transition: background-color 0.3s ease;
    }

    #map-modal-close:hover {
        background-color: rgba(255, 255, 255, 0.6);
    }

    select {
        background-image: url('/assets/panel.png');
        background-size: 100% 100%;
        padding: 10px;
        font-size: 16px;
        color: white;
        font-family: 'Keleti', Arial, sans-serif;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        width: 200px;
        margin-bottom: 10px;
    }
    #active-quests-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000; /* Consistent with other modals */
    justify-content: center;
    align-items: center;
}

#active-quests-modal-content {
    background-image: url('/assets/panel.png');
    background-size: 100% 100%;
    padding: 20px;
    border-radius: 10px;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    width: 600px;
    max-height: 80vh;
    box-sizing: border-box;
}

#active-quests-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding-right: 10px;
}

#no-active-quests-message {
    text-align: center;
    display: none;
    font-size: 16px;
}

#active-quests-modal-close {
    background-image: url('/assets/button.png');
    background-size: 100% 100%;
    background-color: transparent;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    color: white;
    font-family: 'Keleti', Arial, sans-serif;
    width: 150px;
    height: 50px;
    text-align: center;
    line-height: 25px;
    margin: 0 auto;
    transition: background-color 0.3s ease;
}

#active-quests-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.6);
}

.quest-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 100, 0, 0.9);
    color: white;
    padding: 15px;
    border-radius: 5px;
    z-index: 1000;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.quest-notification h3 {
    margin-top: 0;
    color: #ffcc00;
}

.close-notification {
    background: #ffcc00;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 10px;
}

.level-up-ui {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1000;
            background-image: url('/assets/panel.png');
            background-size: cover;
            border-radius: 12px;
            padding: 20px;
            width: 300px;
            font-family: 'Keleti', sans-serif;
            color: white;
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
            animation: slideIn 0.4s ease-out;
        }

        .level-up-content h3 {
            margin-top: 0;
            color: #ffcc00;
            font-size: 18px;
        }

        .level-up-content p {
            font-size: 14px;
            margin: 8px 0 16px;
        }

        .level-up-close {
            background-image: url('/assets/button.png');
            background-size: 100% 100%;
            border: none;
            color: white;
            font-family: 'Keleti', sans-serif;
            font-size: 14px;
            width: 100px;
            height: 36px;
            cursor: pointer;
        }

        .level-up-close:hover {
            opacity: 0.8;
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }
        .quest-complete-ui {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 1000;
            background-image: url('/assets/panel.png');
            background-size: cover;
            border-radius: 12px;
            padding: 20px;
            width: 300px;
            font-family: 'Keleti', sans-serif;
            color: white;
            box-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
            animation: slideIn 0.4s ease-out;
        }

        .quest-complete-content h3 {
            margin-top: 0;
            color: #ffcc00;
            font-size: 18px;
        }

        .quest-complete-content p {
            font-size: 14px;
            margin: 8px 0 16px;
        }

        .quest-complete-close {
            background-image: url('/assets/button.png');
            background-size: 100% 100%;
            border: none;
            color: white;
            font-family: 'Keleti', sans-serif;
            font-size: 14px;
            width: 100px;
            height: 36px;
            cursor: pointer;
        }

        .quest-complete-close:hover {
            opacity: 0.8;
        }

        @keyframes slideIn {
            from {
                transform: translateX(100%);
                opacity: 0;
            }
            to {
                transform: translateX(0);
                opacity: 1;
            }
        }