﻿#map-level-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow: hidden;
    overscroll-behavior: contain;
    z-index: 80;
    background: #000;
}

/* 使 wrap 支持居中（不影响绝对定位背景/marker 等） */
.map-level-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center; /* 垂直居中子内容 */
    justify-content: center; /* 水平居中子内容（保持兼容） */
}
#map-level-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

#map-level-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.map-level-top {
    position: absolute;
    top: 4%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 160px;
    max-width: 80%;
    padding: 10px 20px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.45);
    color: #d49914;
    border: 1px solid;
}

#map-level-title-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-stat-label-desc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 232, 160, 0.18);
    border: 1px solid rgba(255, 232, 160, 0.65);
    color: #fff2c7;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.map-level-title-desc-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 232, 160, 0.18);
    border: 1px solid rgba(255, 232, 160, 0.65);
    color: #fff2c7;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}
#map-level-marker {
    position: absolute;
    z-index: 2;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#map-level-marker-icon {
    width: 64px;
    object-fit: contain;
    display: block;
    pointer-events: none;
}

#map-level-marker-text {
    margin-top: 0px;
    padding: 0px 8px;
    border-radius: 6px;
    background: rgb(0 0 0 / 70%);
    color: #fff7dd;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
}

.map-level-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10%;
    height: 52px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

#map-level-challenge-btn {
    min-width: 165px;
    height: 50px;
    border: 0px solid var(--btn_border_q, #e2c18e);
    font-size: 18px;
    font-weight: 700;
}

    #map-level-challenge-btn:active {
        transform: scale(0.98);
    }

.map3-afk-btn {
    position: absolute;
    right: 20px;
    bottom: 8%;
    max-width: 70px;
    max-width: 60px;
    cursor: pointer;
    z-index: 300;
    pointer-events: auto;
}

.task-daily-marker {
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.wobble {
    animation: task-wobble 0.9s ease-in-out infinite;
    transform-origin: center center;
}

@keyframes task-wobble {
    0% {
        transform: rotate(0deg);
    }

    20% {
        transform: rotate(-7deg);
    }

    40% {
        transform: rotate(6deg);
    }

    60% {
        transform: rotate(-5deg);
    }

    80% {
        transform: rotate(4deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

.map-level-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
}

    .map-level-modal-overlay.hidden {
        display: none;
    }

/* 模态框由 overlay 的 flex 居中；去掉绝对 top/left，使用最大高度限制以适配移动端 */
.map-level-intro-modal {
    position: relative;
    left: auto;
    top: auto;
    width: 95%;
    height: 80%;
    background: var(--btn_bg_s);
    color: var(--btn_color_q);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: map-level-intro-pop 0.22s ease-out;
}

@keyframes map-level-intro-pop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.map-level-intro-header {
    height: 48px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.18);
    position: relative;
    flex: 0 0 auto;
}

#map-level-intro-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--btn_color_q);
    text-align: center;
}

#map-level-intro-close-btn,
#map-level-afk-close-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 17px;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.map-level-intro-body {
    flex: 1 1 auto;
    padding: 18px 16px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 16px;
    color: var(--btn_color_q);
    white-space: pre-wrap;
    word-break: break-all;
}

/* 同理调整挂机奖励列表弹窗 */
.map3-afk-reward-list {
    position: relative;
    left: auto;
    top: auto;
    width: min(900px, 90%);
    max-width: 90%;
    max-height: 80vh;
    min-height: 200px;
    background: var(--btn_bg_s);
    color: var(--btn_color_q);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    padding: 24px 20px 20px;
    box-sizing: border-box;
    overflow: hidden;
    animation: map-level-intro-pop 0.22s ease-out;
}

#map-level-afk-top-icon {
    max-height: 50px;
    display: block;
    margin: 0 auto 12px;
}

#map-level-afk-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 8px 4px;
    gap: 12px;
    font-size: 14px;
}

.map3-afk-info-left {
    text-align: left;
    color: var(--btn_color_q);
}

.map3-afk-info-right {
    text-align: right;
    color: var(--btn_border_q);
}

.map3-afk-items {
    min-height: 80px;
    max-height: 260px;
    overflow-y: auto;
    padding-top: 6px;
}

    .map3-afk-items .bag-item,
    .map3-afk-items .loop-item {
        margin-bottom: 8px;
    }
.map-level-bottom {
    justify-content: center;
}

.map-level-corner-btn {
    position: absolute;
    left: 14px;
    bottom: 4px;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

    .map-level-corner-btn img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

.map3-afk-btn {
    position: absolute;
    right: 20px;
    bottom: 8%;
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 300;
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-level-afk-btn-inner {
    object-fit: contain;
    display: block;
}