.dungeon-panel {
    position: absolute;
    inset: 0;
    z-index: 100;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Close Buttons ===== */
.dungeon-list-close-btn,
.dungeon-map-close-btn {
    position: absolute;
    width: 32px;
    height: 32px;
    border: none;
    padding: 0;
    background: transparent;
    z-index: 30;
    cursor: pointer;
}
.dungeon-list-close-btn { top: 8px; right: 8px; }
.dungeon-map-close-btn { top: 3px; right: 8px; }
.dungeon-list-close-btn img,
.dungeon-map-close-btn img { width: 100%; height: 100%; object-fit: contain; }

/* ===== List View ===== */
.dungeon-list-view,
.dungeon-map-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dungeon-list-header {
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.dungeon-map-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    background: #00000075;
    top: 0px;
    width: 100%;
    z-index: 10000;
    height: 35px;
}

.dungeon-list-title {
}

.dungeon-map-title {
    color: #ffb200;
}

.dungeon-list-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dungeon-list-body::-webkit-scrollbar { display: none; }

/* ===== Tabs ===== */
.dungeon-list-tabs {
    flex: 0 0 44px;
    display: flex;
    border-top: 1px solid #e3a034;
}
.dungeon-tab-btn {
    flex: 1;
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
    .dungeon-tab-btn.btn_on {
        background: #6d531e;
        color: #ffbf18;
    }
    .dungeon-tab-btn.btn_off {
        background: #432f10;
        color: #c4ad7a;
    }

/* ===== List Items ===== */
.dungeon-list-item {
    flex: 0 0 auto;
    height: 32%;
    min-height: 100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    border: 2px solid rgb(255 196 0 / 38%);
    background: #2d1f14;
    transition: border-color 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    padding: 0px;
    box-sizing: border-box;
}
.dungeon-list-item:active { transform: scale(0.98); border-color: rgba(255, 215, 0, 0.5); }
.dungeon-list-item.disabled { opacity: 0.6; cursor: not-allowed; }

.dungeon-list-item-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.dungeon-list-item-content { position: relative; z-index: 1; color: #fff; display: flex; flex-direction: column; gap: 4px; height: 100%; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 14px 0px; border-radius: 8px; }
.dungeon-list-item-name {
    font-size: 20px;
    font-weight: 700;
    color: #ffe7a8;
    margin-left: 10px;
}

.dungeon-list-item-status {
    font-size: 13px;
    color: #81c784;
    margin-left: 10px;
}
.dungeon-list-item-status.completed { color: #aed581; }
.dungeon-list-item-status.locked { color: #e57373; }
.dungeon-list-item-status.sweep { color: #ffd54f; animation: sweepPulse 1.5s ease-in-out infinite; }

.dungeon-list-item-unlock { font-size: 11px; color: #e57373; margin-top: 4px; }
.dungeon-list-item-count {
    font-size: 11px;
    color: #ffee91;
    margin-top: 2px;
    margin-left: 10px;
}
.dungeon-list-lock { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; z-index: 2; }
.dungeon-list-rewards { display: flex; flex-wrap: wrap; gap: 4px; max-height: 110px; overflow-y: auto;scrollbar-width:none; }

.dungeon-sweep-btn {
    display: inline-block;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #1a0e0a;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    /* margin-top: 6px; */
    width: 100px;
    align-self: end;
    height: 30px;
    margin-right: 20px;
}
.dungeon-sweep-btn:active { opacity: 0.8; }

@keyframes sweepPulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

/* ===== Map View ===== */
.dungeon-map-body {
    flex: 1 1 auto;
    position: relative;
    overflow: hidden;
}
.dungeon-map-wrap {
    position: absolute;
    inset: 0;
    overflow: auto;
    display: block;
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior: none;
}
.dungeon-map-wrap::-webkit-scrollbar { display: none; }
.dungeon-map {
    position: relative;
}

/* ===== Hex Cells ===== */
.hex-cell {
    position: absolute;
    cursor: pointer;
    transition: filter 0.25s ease, opacity 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}
.hex-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.25s ease;
}

.hex-cell.s0 {/* filter: brightness(0.3) saturate(0.2); cursor: not-allowed;*/ }
.hex-cell.s0::after { background: rgba(0, 0, 0, 0); }

.hex-cell.s1 { filter: brightness(1) saturate(1); cursor: pointer; animation: hexPulse 2s ease-in-out infinite; }
@keyframes hexPulse { 0%,100%{filter:brightness(1.3)saturate(1)} 50%{filter:brightness(0.7)saturate(1)} }

.hex-cell.s2 { filter: brightness(1) saturate(1); }
    .hex-cell.s2 .cell-bg { filter: brightness(0.6) saturate(1); }

.hex-clearn-mark {
    pointer-events: none;
    display: none;
    user-select: none;
    -webkit-user-select: none;
}

.hex-cell-icon {
    position: absolute;
    width: 65px;
    height: 65px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.hex-cell-icon-box {
    position: absolute;
    width: 50px;
    height: 50px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== Diamond Cells ===== */
.diamond-cell {
    position: absolute;
    cursor: pointer;
    transition: filter 0.25s ease, opacity 0.25s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    user-select: none;
    -webkit-user-select: none;
}
.diamond-cell::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    transition: background 0.25s ease;
}

.diamond-cell.s0::after { background: rgba(0, 0, 0, 0); }

.diamond-cell.s1 { filter: brightness(1) saturate(1); cursor: pointer; animation: diamondPulse 2s ease-in-out infinite; }
@keyframes diamondPulse { 0%,100%{filter:brightness(1.3)saturate(1)} 50%{filter:brightness(1)saturate(1)} }

.diamond-cell.s2 { filter: brightness(1) saturate(1); }
    .diamond-cell.s2 .cell-bg { filter: brightness(0.6) saturate(1); }

.diamond-clearn-mark {
    pointer-events: none;
    display: none;
    user-select: none;
    -webkit-user-select: none;
}

.diamond-cell-icon {
    position: absolute;
    width: 65px;
    height: 65px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.diamond-cell-icon-box {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

@media (max-width: 520px) {
    .dungeon-list-item { min-height: 80px; }
    .dungeon-list-item-name { font-size: 17px; }
}