/* ============================================
   已通关关卡:点击后的完整图预览模态
   (移动端 + 桌面通用)
   ============================================ */

.level-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
}
.level-modal.hidden { display: none; }
.level-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.level-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.level-modal-panel {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 16px;
    background: linear-gradient(135deg, #1c2340 0%, #241b40 100%);
    border: 2px solid rgba(255, 220, 160, .55);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6),
                inset 0 1px 0 rgba(255, 255, 255, .08);
    transform: scale(.92);
    transition: transform .22s ease;
}
.level-modal.show .level-modal-panel { transform: scale(1); }

.level-modal-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 32px;
    height: 32px;
    line-height: 30px;
    text-align: center;
    background: rgba(0, 0, 0, .35);
    color: #ffd7a3;
    border: 1px solid rgba(255, 220, 160, .35);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    padding: 0;
    transition: background .18s, transform .18s;
    z-index: 2;
}
.level-modal-close:hover {
    background: rgba(255, 90, 90, .35);
    transform: scale(1.08);
}

/* 图片外层容器:宽/高由 JS 按图片真实纵横比设置,消除左右空白 */
.level-modal-img-wrap {
    position: relative;
    max-width: 92vw;
    max-height: 62vh;
    background: #0f1220;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.level-modal-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #0f1220;
}

.level-modal-info {
    text-align: center;
    color: #ffe6b8;
    line-height: 1.35;
}
.level-modal-title {
    font-size: 1.05em;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .45);
}
.level-modal-record {
    margin-top: 2px;
    font-size: .78em;
    color: rgba(255, 235, 200, .85);
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 1px;
}

.level-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 2px;
}
.level-modal-play {
    padding: 8px 22px;
    font-weight: 900;
    letter-spacing: 2px;
    font-size: .95em;
}

/* ---------- 响应式:小屏 ---------- */
@media (max-width: 640px) {
    .level-modal-panel {
        max-width: 96vw;
        padding: 10px 10px 12px;
        gap: 8px;
    }
    .level-modal-img-wrap {
        max-width: 92vw;
        max-height: 58vh;
    }
    .level-modal-close {
        width: 28px;
        height: 28px;
        line-height: 26px;
        font-size: 12px;
    }
    .level-modal-title { font-size: .95em; }
    .level-modal-record { font-size: .72em; }
    .level-modal-play {
        padding: 7px 18px;
        font-size: .88em;
    }
}