* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

/* ===== Фон только для главной страницы ===== */
body.main-page {
    background-image: url('img/background-mane.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* ===== Затемнение + размытие при открытых окнах ===== */
#chatDim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    z-index: 500;
}
#chatDim.show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== Верхняя панель иконок справа ===== */
#topIcons {
    position: fixed;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 22px;
    z-index: 20;
}
.icon-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    color: #ffffff;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    transition: transform 0.2s ease;
}
.icon-btn:hover { transform: translateY(-3px); }
.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.icon-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===== Левая колонка ===== */
#leftColumn {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 15;
}

/* Кнопка "Локации" — большая круглая */
#locationsBtn {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background 0.25s ease, transform 0.25s ease;
}
#locationsBtn:hover {
    background: rgba(0, 0, 0, 0.65);
    transform: scale(1.05);
}

/* Карточка "Отправиться в приключение" */
#adventureCard {
    width: 380px;
    padding: 24px 26px;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border-radius: 0 30px 0 0;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease;
}
#adventureCard:hover {
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-2px);
}
.adventure-title {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 8px;
}
.adventure-sub {
    font-size: 14px;
    line-height: 1.45;
    color: rgba(255,255,255,0.9);
    margin-bottom: 14px;
}
.adventure-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #df94e1;
    font-size: 15px;
    font-weight: 600;
}
.exclaim {
    display: inline-flex;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid #df94e1;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Кнопка "Переписка" */
#chatBtn {
    width: 180px;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    font-size: 16px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.25s ease;
    font-family: inherit;
}
#chatBtn:hover { background: rgba(0, 0, 0, 0.65); }

/* ===== Правая колонка — персонажи ===== */
#charactersPanel {
    position: fixed;
    top: 120px;
    right: 30px;
    bottom: 30px;
    width: 260px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 6px;
    z-index: 15;
}
#charactersPanel::-webkit-scrollbar { width: 6px; }
#charactersPanel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
}
.character-btn {
    display: flex;
    flex-direction: row-reverse;      /* меняет порядок: имя слева, иконка справа */
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    text-shadow: 0 2px 6px rgba(0,0,0,0.7);
    font-family: inherit;
    text-align: left;
}
.character-btn:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(-3px);
}
.character-btn img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.7);
}

/* ===== Модальное окно миссий ===== */
#missionsModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    padding: 80px 40px 40px 40px;
}
#missionsModal.show { display: block; }

#closeMissions {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.85;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
#closeMissions:hover { transform: scale(1.15); opacity: 1; }

#missionsLogo {
    position: absolute;
    top: 25px;
    left: 40px;
}
#missionsLogo img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

#missionsFilters {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
}
.filter-btn {
    padding: 10px 26px;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: 1.5px solid rgba(255,255,255,0.7);
    border-radius: 20px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit;
}
.filter-btn:hover { background: rgba(159, 126, 221, 0.5); }
.filter-btn.active {
    background: linear-gradient(to right, #9f7edd, rgba(159,126,221,0.3));
    border-color: #ffffff;
}

/* ===== Тело модалки ===== */
#missionsBody {
    display: flex;
    gap: 30px;
    height: calc(100% - 60px);
    margin-top: 60px;
}

/* Левая колонка со списком квестов */
#questList {
    width: 45%;
    overflow-y: auto;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
#questList::-webkit-scrollbar { width: 8px; }
#questList::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
}

/* Главная кнопка квеста */
.quest-main-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px 0 0;      /* убираем паддинг слева — иконка прижата к краю */
    background: linear-gradient(to right, #9f7edd, rgba(159,126,221,0));
    border: 1.5px solid #ffffff;
    border-radius: 40px 0 0 40px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: transform 0.2s ease, filter 0.2s ease;
    height: 74px;             /* фиксируем высоту — кружок будет ровно по ней */
    overflow: hidden;         /* чтобы круглая иконка не вылезала за пределы */
}

.quest-main-btn:hover { filter: brightness(1.15); transform: translateX(4px); }

.quest-main-btn .icon {
    width: 74px;              /* = высоте кнопки */
    height: 74px;             /* = высоте кнопки */
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    border: 1.5px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    margin-left: -1.5px;      /* компенсируем бордер кнопки, чтобы кружок упирался ровно */
    margin-top: -1.5px;
    margin-bottom: -1.5px;
}
.quest-main-btn .icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Подкнопки (без иконок, без скруглений) */
.quest-sub-list {
    display: none;
    flex-direction: column;
    gap: 4px;
    margin-left: 30px;
    margin-top: 4px;
}
.quest-sub-list.open { display: flex; }

.quest-sub-btn {
    padding: 10px 18px;
    background: transparent;
    border: 1.5px solid #ffffff;
    color: #ffffff;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.quest-sub-btn:hover { background: rgba(255,255,255,0.15); }
.quest-sub-btn .sub-title { font-size: 15px; font-weight: 600; }
.quest-sub-btn .sub-type {
    font-size: 12px;
    color: #cccccc;
    margin-top: 3px;
}
.quest-sub-btn .sub-types span { cursor: pointer; }
.quest-sub-btn .sub-types span:hover { color: #df94e1; }

/* Правая колонка — описание */
#questDescription {
    flex: 1;
    background: rgba(0, 0, 0, 0.35);
    border: 1.5px solid rgba(255,255,255,0.35);
    border-radius: 20px 0 0 0;
    padding: 30px;
    color: #ffffff;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
}
.desc-placeholder {
    margin: auto;
    color: rgba(255,255,255,0.6);
    font-size: 16px;
}
.desc-type {
    color: #cccccc;
    font-size: 13px;
    margin-bottom: 10px;
}
.desc-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 16px;
}
.desc-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255,255,255,0.9);
    flex: 1;
}
.desc-go-btn {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 26px;
    background: #ffffff;
    color: #2a1a6b;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    margin-top: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.desc-go-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(255,255,255,0.3);
}

/* ===== Окно переписки ===== */
#chatModal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 600;
    align-items: center;
    justify-content: center;
}
#chatModal.show { display: flex; }

#chatWindow {
    width: 420px;
    height: 560px;
    background: #f4f0fb;
    border-radius: 0 30px 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: popIn 0.3s ease;
}
@keyframes popIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

#chatHeader {
    background: #2a1a6b;
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.chat-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #df94e1;
}
.chat-name {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
#closeChat {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.85;
}
#closeChat:hover { opacity: 1; }

#chatMessages {
    flex: 1;
    padding: 18px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f4f0fb;
}
#chatMessages::-webkit-scrollbar { width: 6px; }
#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(42,26,107,0.3);
    border-radius: 3px;
}

.message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}
.message.incoming {
    background: #ffffff;
    color: #2a1a6b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message.outgoing {
    background: #9f7edd;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message.sticker-msg {
    font-size: 40px;
    background: transparent;
    padding: 4px 8px;
}

#chatInputRow {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1px solid #e0d7f0;
}
#stickerBtn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e9e2f7;
    border: none;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s ease;
}
#stickerBtn:hover { background: #df94e1; }

#chatInput {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #d5c9ee;
    border-radius: 20px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: #2a1a6b;
}
#chatInput:focus { border-color: #9f7edd; }

#chatSend {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2a1a6b;
    color: #ffffff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}
#chatSend:hover { background: #4134a2; }

/* ===== Окно со стикерами ===== */
#stickersPopup {
    display: none;
    position: fixed;
    z-index: 700;
    background: #ffffff;
    border-radius: 16px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    width: 200px;
}
#stickersPopup.show { display: grid; }
.sticker {
    font-size: 26px;
    text-align: center;
    padding: 6px;
    cursor: pointer;
    border-radius: 10px;
    transition: background 0.15s ease, transform 0.15s ease;
}
.sticker:hover {
    background: #f0e9ff;
    transform: scale(1.15);
}