/* ==========================================================================
   1. 전역 본문 스킨 및 유연한 메인 컨테이너 레이아웃
   ========================================================================== */
html, body {
    background-color: #121214 !important;
    color: #e1e1e6 !important;
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    padding: 20px;
    margin: 0;
    width: 100%;
    min-height: 100%; 
    box-sizing: border-box;
}

.container {
    max-width: 520px;
    width: 100%;
    height: auto; 
    background: #1a1a1e !important;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #29292e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-bottom: 40px; 
    box-sizing: border-box;
}

.mt-20 { 
    margin-top: 20px !important; 
}

/* ==========================================================================
   2. 상단 국기 전환 버튼, 로고 및 타이틀 서식
   ========================================================================== */
#btn-lang-toggle:hover {
    background: #29292e !important;
    border-color: #f3b63a !important;
}

.logo-area-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 85px;
    margin-top: 5px;
    margin-bottom: 15px;
}

.center-logo-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

h2 {
    color: #a8a8b3;
    font-size: 13px;
    margin: 0 0 15px;
}

h3 {
    color: #fff;
    font-size: 15px;
    margin: 15px 0 10px;
    text-align: left;
    border-left: 4px solid #f3b63a;
    padding-left: 8px;
}
/* ==========================================================================
   3. 재화 자산 입력창 셋 및 보유량/소모 현황판
   ========================================================================== */
.asset-manager {
    background: #202024;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.asset-inputs {
    display: flex;
    justify-content: space-around;
    margin-bottom: 8px;
}

.input-group { 
    font-size: 12px; 
    color: #a8a8b3; 
}

.input-group input {
    background: #121214;
    border: 1px solid #3e3e44;
    color: #fff;
    padding: 4px;
    width: 55px;
    border-radius: 4px;
    text-align: center;
}

.module-status {
    display: flex;
    justify-content: space-around;
    font-weight: bold;
    font-size: 12px;
    background: #1a1a1e;
    padding: 8px;
    border-radius: 6px;
}

.stat-blue { 
    color: #f3b63a; 
}

.btn-reset {
    background: #3e3e44;
    color: #fff;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    margin-top: 6px;
}

/* ==========================================================================
   4. 장비 부위 선택 네비게이션 카드 레이아웃
   ========================================================================== */
.eq-selector { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 8px; 
}

.eq-card {
    background: #202024;
    border: 2px solid #29292e;
    border-radius: 8px;
    padding: 8px 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-sizing: border-box;
}

.eq-icon { 
    width: 35px; 
    height: 35px; 
    margin-bottom: 4px; 
}

.eq-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #3e3e44;
}

.eq-card span { 
    font-size: 11px; 
    color: #a8a8b3; 
}

.eq-card.active { 
    border-color: #f3b63a; 
    background: #2d2a22; 
}

.eq-card.active span { 
    color: #f3b63a; 
    font-weight: bold; 
}
/* ==========================================================================
   5. 메인 화면 옵션 슬롯 카드 및 고정/1회 잠금 토글 컨트롤
   ========================================================================== */
.slot-row {
    background: #202024;
    border: 1px solid #29292e;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slot-main-info { 
    display: flex; 
    flex-direction: column; 
    text-align: left; 
}

.slot-info { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 4px; 
    font-size: 12px; 
    color: #8d8d99; 
}

.lock-toggle-btn {
    background: #29292e;
    color: #fff;
    border: 1px solid #3e3e44;
    padding: 2px 8px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all .2s ease;
}

.lock-toggle-btn.btn-module-locked { 
    background: #1d3557; 
    border-color: #457b9d; 
    color: #f3b63a; 
}

.lock-toggle-btn.btn-key-locked { 
    background: #3e3216; 
    border-color: #f3b63a; 
    color: #f3b63a; 
}

.material-selector { 
    display: flex; 
    gap: 8px; 
    background: #1a1a1e; 
    padding: 6px; 
    border-radius: 6px; 
    border: 1px dashed #3e3e44; 
}

.material-selector.hidden { 
    display: none !important; 
}

.btn-mat-select { 
    flex: 1; 
    padding: 6px; 
    font-size: 11px; 
    font-weight: bold; 
    border-radius: 4px; 
    cursor: pointer; 
    position: relative; 
    border: 1px solid transparent; 
}

.mat-mod { 
    background: #1d3557; 
    color: #a8dadc; 
    border-color: #457b9d; 
}

.mat-key { 
    background: #3e3216; 
    color: #f3b63a; 
    border-color: #f3b63a; 
}

/* ==========================================================================
   6. 메인 화면용 슬롯 결과창 텍스트 및 기본 등급 티어 뱃지
   ========================================================================== */
.slot-result { 
    font-size: 14px; 
    font-weight: bold; 
    padding-left: 5px; 
    min-height: 22px; 
    text-align: left; 
    word-break: keep-all;
    line-height: 1.35;
}

.stat-normal { 
    color: #fff; 
}

.stat-blue-label { 
    color: #4aa3ff; 
    text-shadow: 0 0 6px rgba(74, 163, 255, 0.4); 
}

.stat-black-label { 
    color: #fff; 
    background: #000; 
    padding: 2px 6px; 
    border-radius: 4px; 
    border: 1px solid #f3b63a; 
}

.tier-badge { 
    display: inline-block; 
    background: #29292e; 
    font-size: 11px; 
    padding: 2px 6px; 
    border-radius: 3px; 
    margin-right: 8px; 
    color: #8d8d99; 
}

.tier-badge.blue-label { 
    background: #1d3557; 
    color: #4aa3ff; 
    border: 1px solid #4aa3ff; 
}

.tier-badge.black-label { 
    background: #f3b63a; 
    color: #000; 
    font-weight: bold; 
}
/* ==========================================================================
   7. 메인 제어 콘솔 및 방주 관리 AI 에닉 패널
   ========================================================================== */
.control-box { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-bottom: 10px; 
}

.btn-main { 
    background: #f3b63a; 
    color: #121214; 
    border: none; 
    padding: 14px; 
    font-size: 15px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    position: relative; 
}

.btn-main:disabled, .btn-sub:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
}

.btn-sub { 
    background: #29292e; 
    color: #fff; 
    border: 1px solid #3e3e44; 
    padding: 10px; 
    font-size: 13px; 
    font-weight: bold; 
    border-radius: 6px; 
    cursor: pointer; 
    position: relative; 
}

.warning-toggle-box { 
    background: #202024; 
    padding: 10px; 
    border-radius: 6px; 
    border: 1px solid #29292e; 
    text-align: left; 
    margin-top: 5px; 
}

.warning-label { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 12px; 
    color: #fff; 
    cursor: pointer; 
    user-select: none; 
}

.warning-label input[type="checkbox"] { 
    width: 14px; 
    height: 14px; 
    accent-color: #f3b63a; 
}

.enikk-guide-panel {
    background: #11141a;
    border: 1px solid #4aa3ff;
    padding: 12px;
    border-radius: 8px;
    text-align: left;
    box-shadow: inset 0 0 10px rgba(74, 163, 255, 0.2);
    height: 150px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.enikk-title { 
    font-size: 12px; 
    font-weight: bold; 
    color: #4aa3ff; 
    border-bottom: 1px solid #4aa3ff33; 
    padding-bottom: 4px; 
    margin-bottom: 6px; 
    flex-shrink: 0; 
}

.enikk-content { 
    font-size: 12.5px; 
    color: #e1e1e6; 
    line-height: 1.45; 
    height: 73px; 
    overflow-y: auto; 
    flex-grow: 1; 
    white-space: normal; 
    word-break: keep-all; 
}

.stat-gold-highlight { 
    color: #ffca28; 
    font-weight: bold; 
    text-shadow: 0 0 8px rgba(255, 202, 40, 0.5); 
}

/* ==========================================================================
   8. 하단 집계 통계 보드 및 시뮬레이션 필터 폼
   ========================================================================== */
.summary-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #202024; 
    border-radius: 6px; 
    font-size: 13px; 
}

.summary-table th { 
    background: #29292e; 
    color: #a8a8b3; 
    padding: 8px; 
    font-weight: bold; 
}

.summary-table td { 
    padding: 8px; 
    border-bottom: 1px solid #1a1a1e; 
    color: #fff; 
}

.filter-box { 
    background: #1e222b; 
    border: 1px solid #4a75a0; 
    padding: 15px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
}

.filter-grid { 
    display: grid; 
    grid-template-columns: repeat(1, 1fr); 
    gap: 6px; 
}

.filter-item { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: #121214; 
    padding: 6px 12px; 
    border-radius: 4px; 
    border: 1px solid #29292e; 
    font-size: 13px; 
}

.filter-controls { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.filter-controls input[type="number"] { 
    width: 45px; 
    background: #1a1a1e; 
    border: 1px solid #4a75a0; 
    color: #f3b63a; 
    padding: 2px; 
    border-radius: 4px; 
    text-align: center; 
    font-weight: bold; 
}

.estimation-box { 
    margin-top: 15px; 
    background: #121214; 
    border: 1px dashed #4a75a0; 
    padding: 10px; 
    border-radius: 6px; 
    color: #f3b63a; 
    font-size: 13.5px; 
    font-weight: bold; 
    text-align: left; 
}
/* ==========================================================================
   9. 모달 내 제목 하단 여백 및 가로 스크롤바 감도 확장 서식
   ========================================================================== */
.global-system-modal h3 {
    margin: 0 0 20px 0 !important;   
    border-left: 4px solid #4aa3ff !important;
    font-size: 15px !important;
    text-align: left !important;
}

.value-modal-tabs {
    display: flex; gap: 5px; overflow-x: auto; padding-bottom: 8px !important; 
    border-bottom: 1px solid #29292e; scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.value-modal-tabs::-webkit-scrollbar { height: 12px !important; }
.value-modal-tabs::-webkit-scrollbar-thumb { 
    background: #b58422 !important; 
    background-clip: padding-box !important; 
    border-top: 4px solid transparent !important;    
    border-bottom: 4px solid transparent !important; 
    border-radius: 6px !important; 
} 
.value-modal-tabs::-webkit-scrollbar-thumb:hover { background: #d49c2a !important; background-clip: padding-box !important; }
.value-modal-tabs::-webkit-scrollbar-track { background: transparent !important; }

.value-modal-tab-btn {
    background: #202024; color: #a8a8b3; border: 1px solid #29292e; padding: 6px 10px;
    font-size: 11px; font-weight: bold; border-radius: 4px; cursor: pointer;
    white-space: nowrap; transition: all 0.15s ease-in-out;
}

.value-modal-tab-btn:hover { background: #29292e; color: #fff; }
.value-modal-tab-btn.active { 
    background: rgba(243, 182, 58, 0.2) !important; 
    color: #f3b63a !important;                       
    border-color: #f3b63a !important;                 
}

.value-modal-content-area { flex: 1; overflow-y: auto; max-height: 55vh; padding-right: 2px; }
.value-modal-content-area::-webkit-scrollbar { width: 5px; }
.value-modal-content-area::-webkit-scrollbar-thumb { background: #29292e; border-radius: 3px; }
.val-table-weight-blue, .val-table-weight-white { color: #ffffff !important; font-weight: bold; }

/* ==========================================================================
   10. 에닉 내비게이션 토글 및 홈 화면 3형제 버튼 밸런싱/톤다운 리스킨
   ========================================================================== */
#btn-enikk-toggle {
    display: inline-block !important; margin: 0 0 0 6px !important; line-height: normal !important;
    position: relative !important; z-index: 100 !important; border: 1px solid transparent !important;
    border-radius: 4px !important; padding: 4px 10px !important;       
    font-size: 11px !important; font-weight: bold !important; cursor: pointer !important; 
    transition: all .15s ease-in-out !important; white-space: nowrap !important; 
    font-family: inherit !important; outline: none !important; text-shadow: none !important; 
    box-sizing: border-box !important;
}

.btn-enikk-active, #btn-enikk-toggle.btn-enikk-active { background: #1d3557 !important; color: #4aa3ff !important; border: 1px solid #4aa3ff !important; }
.btn-enikk-active:hover, #btn-enikk-toggle.btn-enikk-active:hover { background: #25466c !important; }
.btn-enikk-disabled, #btn-enikk-toggle.btn-enikk-disabled { background: #29292e !important; color: #8d8d99 !important; border: 1px solid #3e3e44 !important; }
.btn-enikk-disabled:hover, #btn-enikk-toggle.btn-enikk-disabled:hover { background: #34343a !important; }

.btn-prob {
    background: #29292e !important;
    color: #8d8d99 !important;
    border: 1px solid #3e3e44 !important;
    padding: 4px 8px !important;     
    font-size: 11px !important;     
    margin: 0 !important;
    font-weight: bold !important;
    border-radius: 4px !important;  
    height: auto !important;
    line-height: normal !important;
}
.btn-prob:hover {
    color: #ffffff !important;
    background: #34343a !important;
}

/* ==========================================================================
   11. 🔴 레드닷 상시 노출 방지 및 공통 모달 오버레이 프레임
   ========================================================================== */
.guide-dot { display: none !important; }
.guide-dot.active-dot { display: inline-block !important; }

html:has(.global-system-modal[style*="flex"]),
body:has(.global-system-modal[style*="flex"]) {
    overflow: hidden !important;
    touch-action: none !important;
}

.global-system-modal {
    display: none; 
    position: fixed !important; top: 0 !important; left: 0 !important; 
    width: 100% !important; height: 100% !important; 
    background: rgba(7, 8, 10, 0.94) !important; 
    z-index: 20000 !important; box-sizing: border-box !important;
    align-items: center !important; justify-content: center !important; 
    overscroll-behavior: contain !important;
}

.manual-box-normal, #prob-modal > div, .modal-box-normal, .modal-box-alert, .modal-box-scaling {
    background: #1a1a1e !important;
    border: 0.5px solid #4aa3ff !important; 
    border-radius: 12px !important;
    box-shadow: 0 0 25px rgba(74, 163, 255, 0.25) !important;
    box-sizing: border-box !important;
}

.modal-box-normal { max-width: 480px !important; width: 90% !important; padding: 15px; }
.modal-box-alert { max-width: 400px !important; width: 85% !important; padding: 20px !important; display: flex !important; flex-direction: column !important; gap: 14px !important; height: auto !important; }
#enikk-alert-modal .btn-main { background: #f3b63a !important; color: #121214 !important; font-size: 13px !important; font-weight: bold !important; border: none !important; border-radius: 6px !important; }
/* ==========================================================================
   12. 오버로드 옵션 대조 모달 50:50 분할 및 독립 에닉 패널 서식
   ========================================================================== */
.modal-box-scaling {
    max-width: 710px !important; 
    width: 95% !important; 
    padding: 20px !important; 
    gap: 16px !important; 
    display: flex !important; 
    flex-direction: column !important;
}

#comp-modal .comp-split-container {
    display: flex !important; flex-direction: row !important; 
    background: #121214 !important; border: 1px solid #29292e !important; border-radius: 8px !important;
    padding: 14px 10px !important; gap: 0 !important; min-height: 255px !important;   
    box-sizing: border-box !important; width: 100% !important;
    align-items: center !important;
}

#comp-modal .comp-panel-side {
    flex: 1 !important; width: 47% !important; display: flex !important; 
    flex-direction: column !important; box-sizing: border-box !important; margin: 0 !important;            
    overflow-x: visible !important;
}

#comp-modal .comp-center-line {
    width: 2px !important; display: block !important;
    background: linear-gradient(to bottom, transparent, #4a75a0, transparent) !important;
    align-self: stretch !important; margin: 0 auto !important; flex-shrink: 0 !important;
}

#comp-enikk-panel {
    background: #11141a !important;
    border: 1px solid #4aa3ff !important;
    box-shadow: inset 0 0 10px rgba(74, 163, 255, 0.2) !important;
    height: 185px !important; 
}

#comp-enikk-panel .enikk-title {
    color: #4aa3ff !important;
    border-bottom: 1px solid rgba(74, 163, 255, 0.2) !important;
}

#comp-enikk-panel .enikk-content {
    height: 110px !important;
}

#btn-comp-enikk-toggle {
    display: inline-block !important; margin: 0 0 0 6px !important; line-height: normal !important;
    position: relative !important; z-index: 100 !important; border: 1px solid transparent !important;
    border-radius: 4px !important; padding: 4px 10px !important;       
    font-size: 11px !important; font-weight: bold !important; cursor: pointer !important; 
    transition: all .15s ease-in-out !important; white-space: nowrap !important; 
    font-family: inherit !important; outline: none !important; text-shadow: none !important; 
    box-sizing: border-box !important;
}

#btn-comp-enikk-toggle.btn-enikk-active {
    background: #1d3557 !important;
    color: #4aa3ff !important;
    border: 1px solid #4aa3ff !important;
}

#btn-comp-enikk-toggle.btn-enikk-disabled {
    background: #29292e !important;
    color: #8d8d99 !important;
    border: 1px solid #3e3e44 !important;
}

#comp-modal .tier-badge {
    font-size: 12.5px !important; padding: 2px 5px !important; margin-right: 8px !important;         
    display: inline-block !important; border-radius: 3px !important; flex-shrink: 0 !important;            
}
#comp-modal .tier-badge.blue-label { background: #1d3557 !important; color: #4aa3ff !important; border: 1px solid #4aa3ff !important; }
#comp-modal .tier-badge.black-label { background: #f3b63a !important; color: #000 !important; font-weight: bold !important; }

#comp-modal .stat-blue-label, #comp-modal .stat-black-label, #comp-modal .stat-normal { 
    font-size: 12.5px !important; 
    white-space: normal !important;
    overflow: visible !important; 
    text-overflow: clip !important;
}

#comp-modal .btn-sub {
    font-size: 16px !important; 
    padding: 14px !important; 
    border-radius: 8px !important; 
    background: transparent !important;       
    color: #f3b63a !important;                
    border: 1px solid #f3b63a !important;     
    font-weight: bold !important;
    cursor: pointer !important;
}
#comp-modal .btn-sub:hover { 
    background: rgba(243, 182, 58, 0.1) !important; 
}

#comp-modal .btn-main {
    font-size: 16px !important; 
    padding: 14px !important; 
    border-radius: 8px !important; 
    background: #3e3e44 !important;           
    color: #ffffff !important;                
    border: 1px solid #4e4e55 !important;
    font-weight: bold !important;
    cursor: pointer !important;
}
#comp-modal .btn-main:hover { 
    background: #4e4e55 !important; 
}

#comp-modal .comp-panel-side h4 { 
    font-size: 14px !important; 
    margin-bottom: 12px !important; 
    text-align: center !important;  
    width: 95% !important;
}

#comp-modal .comp-slot-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
}

#comp-modal .comp-slot-item {
    background: #202024 !important;
    border: 1px solid #2b2b30 !important;
    border-radius: 6px !important;
    padding: 12px 14px !important;
    font-size: 12.5px !important;
    font-weight: bold !important;
    color: #ffffff !important;
    min-height: 56px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    width: 94% !important;
    white-space: normal !important;
    word-break: keep-all !important;
    line-height: 1.3 !important;
    overflow: hidden !important;
}

#comp-modal .comp-panel-side:first-child .comp-slot-item { margin: 0 auto 0 0 !important; }
#comp-modal .comp-panel-side:last-child .comp-slot-item { margin: 0 0 0 auto !important; }

.comp-meta-box {
    display: inline-block !important;
    background: #29292e !important;
    color: #ffffff !important;
    border: 1px solid #3e3e44 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: bold !important;
    margin-right: 6px !important;
}

.comp-val-blue { color: #4aa3ff !important; font-weight: bold; text-shadow: 0 0 6px rgba(74, 163, 255, 0.4); }
.comp-val-gold { color: #f3b63a !important; font-weight: bold; text-shadow: 0 0 8px rgba(243, 182, 58, 0.5); }
.comp-val-normal { color: #ffffff !important; }

#comp-modal span[id^="comp-prev-dot-"], 
#comp-modal span[id^="comp-curr-dot-"] {
    font-size: 11px !important;
    margin-left: 8px !important;
    color: #ff4a4a !important;
    animation: enikkPulse 1.8s infinite ease-in-out;
}

@keyframes enikkPulse {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}
