/* ===========================================
   PERFORMANCE OVERRIDES
   저사양 기기 최적화를 위한 렌더링 비용 절감
   - backdrop-filter 제거 → 불투명 배경 대체
   - 무거운 box-shadow 축소
   - will-change 제한
   =========================================== */

/* [PERF] Glass 버튼 — blur 제거, 불투명도 높임 */
.glass-btn {
    background: rgba(15, 15, 25, 0.88) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* [PERF] Cyber 패널 — blur 제거 */
.cyber-panel {
    background: rgba(10, 20, 30, 0.92) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* [PERF] 바텀시트 오버레이 — blur 제거 */
.bottom-sheet-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

.bottom-sheet-overlay.active {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: rgba(0, 0, 0, 0.6) !important;
}

/* [PERF] 모달 배경 — blur 제거 */
.modal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* [PERF] game_ui.css backdrop-filter 제거 */
.modal-content,
.game-over-overlay,
#review-modal .modal-content {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* [PERF] survival.css backdrop-filter 제거 */
.survival-panel,
.survival-result-overlay,
.survival-result-panel,
.survival-stats-panel,
.survival-golem-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* [PERF] 무한 heart-pulse 애니메이션 경량화 — filter 제거 */
@keyframes heart-pulse {
    0%, 100% { transform: scale(1); }
    15% { transform: scale(1.15); }
    30% { transform: scale(1.03); }
    45% { transform: scale(1.1); }
}

/* [PERF] GPU 합성 레이어 최적화 */
#game-container,
#main-container,
.view.active {
    will-change: auto;
    transform: translateZ(0);
}

/* ===== 게임모드 선택 모달 최적화 ===== */

/* [PERF] 슬라이더 thumb — 외부 텍스처 URL 제거 + box-shadow 경량화 */
input[type=range].parchment-slider::-webkit-slider-thumb {
    background-image: radial-gradient(circle at 35% 35%, #f5f1e0 0%, #d4cb97 100%) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.5) !important;
    transition: none !important;
    will-change: transform;
    transform: translateZ(0);
}

input[type=range].parchment-slider::-moz-range-thumb {
    background-image: radial-gradient(circle at 35% 35%, #f5f1e0 0%, #d4cb97 100%) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

/* [PERF] 슬라이더 — 모바일 터치 최적화 + auto-zoom 방지 */
input[type=range].parchment-slider {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-size: 16px;
}

/* [PERF] 모달 전체 — 더블탭/핀치줌에 의한 화면 리사이즈 차단 */
#mode-select-modal,
#mode-select-modal * {
    touch-action: manipulation;
}

/* [PERF] 모달 frame — GPU 레이어 승격 */
.loc-modal-frame {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* [PERF] 모달 내 parchment 텍스처 — 외부 URL 합성 비용 제거 */
#mode-select-modal .loc-parchment-texture {
    background-image: none !important;
    background: rgba(200, 180, 140, 0.03) !important;
}

/* [PERF] slideUpBounce 대체: opacity 변경 없이 transform만 사용 */
@keyframes slideUpBounce {
    0% {
        transform: translateY(100%) translateZ(0);
    }
    60% {
        transform: translateY(-3%) translateZ(0);
    }
    80% {
        transform: translateY(1%) translateZ(0);
    }
    100% {
        transform: translateY(0) translateZ(0);
    }
}

/* [PERF] mode-select 모달: 오버레이를 완전 불투명으로 만들어 뒤 화면 합성 비용 제거 */
#mode-select-modal {
    background: rgb(25, 25, 35) !important;
    overscroll-behavior: contain; /* 모달 내 스크롤이 뒤 화면에 전파 방지 */
}

/* [PERF] 모달 frame — GPU 레이어 승격 + 불필요한 장식 제거 */
#mode-select-modal .loc-modal-frame {
    will-change: transform, opacity;
    backface-visibility: hidden;
}

/* [PERF] 모달 내 아이콘 — filter: drop-shadow 제거 */
#mode-select-modal .survival-badge,
#mode-select-modal .manual-icon-container {
    filter: none !important;
}

/* [PERF] 모달 내 SVG 필터 비활성화 */
#mode-select-modal .survival-heart-main {
    filter: none !important;
}

/* [PERF] 모달 내 badge 장식 레이어 숨김 */
#mode-select-modal .survival-badge-grid,
#mode-select-modal .survival-badge-shadow,
#mode-select-modal .survival-badge-glass {
    display: none !important;
}

/* [PERF] 모달 내 box-shadow 경량화 */
#mode-select-modal .manual-btn-wrapper {
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), inset 0 1px 3px rgba(255,255,255,0.5) !important;
}

/* [PERF] 모달 내 parchment 텍스처 — 외부 URL 제거 */
#mode-select-modal .loc-parchment-texture {
    background-image: none !important;
    background: rgba(200, 180, 140, 0.03) !important;
}

/* [PERF] 모달 내 glossy-shine — 거대 레이어 제거 */
#mode-select-modal .loc-glossy-shine {
    display: none !important;
}
