/* 인덱스(index.html) 전용 — 헤더·설정·지역 선택·스킬 박스·가상 키보드·EP 계산기·하단 내비·공지/통계 위젯·계정 시트. */

/* index.html 전용 - 다른 페이지도 이 index.css를 공유하므로, 바디 셀렉터를
   #indexBody로 한정해서 이 flex 중앙 정렬이 다른 페이지로 새어나가지 않게 함
   (다른 페이지 body가 flex+align-items:center를 물려받으면 본문 폭이 좁아짐) */
body#indexBody {
    font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* standalone(홈 화면에 추가)으로 실행하면 상태바가 콘텐츠 위에 겹쳐(black-translucent)
       로고·설정 버튼이 가려지므로 안전영역만큼 띄움. 일반 브라우저 탭에서는 env()가 0. */
    padding-top: calc(15px + env(safe-area-inset-top));
    padding-bottom: calc(160px + env(safe-area-inset-bottom));
}

/* iOS 홈 화면 앱: 맨 위 가장자리에 hit-test 되는 불투명 fixed 요소가 있어야 상태 표시줄 흐림이 꺼짐.
   시트 오버레이(4000)보다 아래. 본문 위 여백(15px+안전영역)보다 낮아 내용을 가리지 않음. */
#iosTopTint { display: none; }
html.ios-pwa #iosTopTint {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(env(safe-area-inset-top, 0px) + 8px);
    background-color: var(--bg-color);
    z-index: 3900;
}

/* ══════════════════════════════════════════════════════════════════
 * 레이아웃 · 헤더
 * ══════════════════════════════════════════════════════════════════ */
/* ── 상단 헤더 영역 (정렬 버튼 포함) ── */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 0 auto 20px auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sort-toggle-btn.gz-link-btn { border-radius: 50%; text-decoration: none; }
.gz-link-ico {
    width: 24px; height: 24px; background: currentColor; pointer-events: none;
    -webkit-mask: url(../../assets/globe.svg) center / contain no-repeat;
    mask: url(../../assets/globe.svg) center / contain no-repeat;
}
.logo {
    width: 60px;
    height: auto;
    filter: invert(48%) sepia(60%) saturate(400%) hue-rotate(5deg) brightness(0.85);
}

.header-text h1 {
    font-size: 1.3em;
    margin: 0;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 3px;
}

/* ══════════════════════════════════════════════════════════════════
 * 버튼 · 토글 · 드롭다운
 * ══════════════════════════════════════════════════════════════════ */
/* ── 한/영 정렬 전환 버튼 (SVG 아이콘 전용) ── */
.sort-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    color: var(--text-color);
    flex-shrink: 0;
    transition: all var(--transition);
}

/* SVG 아이콘 크기 및 색상 동기화 */
.sort-toggle-btn svg,
.sort-toggle-btn img {
    width: 24px;
    height: 24px;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: none;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* 마우스 오버 및 클릭 시 스타일 */
.sort-toggle-btn:hover,
.sort-toggle-btn:active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* 클릭할 때 아이콘이 살짝 눌리는 애니메이션 효과 */
.sort-toggle-btn:active svg { transform: scale(0.85); }

/* 개별 퀘스트 스킬 예외 토글 스위치 (기본: OFF/회색, 예외 지정 시 ON/강조색) */
.toggle-switch {
    position: relative;
    width: 30px;
    height: 17px;
    flex-shrink: 0;
    border: none;
    border-radius: 999px;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.2s ease;
    vertical-align: middle;
    margin-left: 6px;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 15px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: left 0.2s ease;
}

.toggle-switch.is-off { background: var(--border-color); }
.toggle-switch.is-off::before { left: 2px; }

/* 홈 화면에 추가 안내 — 계정 시트 설정 영역의 버튼 + NEW 배지 */
.settings-install-btn {
    flex-shrink: 0;
    padding: 5px 10px;
    font-size: 0.78em;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--accent-color);
    background: transparent;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
}

.settings-install-btn:active { background: var(--accent-color); color: var(--card-bg); }

.settings-new-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 1px 5px;
    font-size: 0.68em;
    font-weight: 700;
    color: #fff;
    background: var(--danger-color);
    border-radius: 999px;
    vertical-align: middle;
}

.settings-new-badge[hidden] { display: none; }

/* ══════════════════════════════════════════════════════════════════
 * 폼 요소
 * ══════════════════════════════════════════════════════════════════ */
/* ── 지역 고유 스킬 섹션 ── */
.province-hint {
    margin: 8px 0 0 0;
    font-size: 0.78em;
    color: var(--text-sub);
    line-height: 1.6;
    opacity: 0.8;
}

.province-section {
    width: 100%;
    max-width: 800px;
    background: transparent;
    padding: 1px;
    border-radius: 12px;
    border: none;
    margin-bottom: 20px;
    box-shadow: none;
}

.province-dropdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.province-label {
    font-size: 0.88em;
    font-weight: 700;
    color: var(--text-sub);
    white-space: nowrap;
    flex-shrink: 0;
}

.province-dropdown-row .custom-dropdown { flex: 1; }

/* ── 공용 커스텀 드롭다운 ──
   네이티브 <select>는 <option> 안에 이미지를 그릴 수 없어 지역/클래스/스킬 라인 선택에 씀.
   실제 값은 화면에서 숨긴 <select>가 들고 있고, 이 클래스들은 그 위에 씌우는 시각적 UI.
   일반 페이지 흐름 안에 있으므로 메뉴가 버튼 아래쪽으로 펼쳐짐. */
.custom-dropdown {
    position: relative;
}

.custom-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: 'Noto Sans KR', sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
}

.custom-dropdown-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-dropdown-caret {
    flex-shrink: 0;
    color: var(--accent-color);
    font-size: 0.8em;
}

.custom-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.15));
    padding: 6px;
    display: none;
    flex-direction: column;
    gap: 2px;
    max-height: 50vh;
    overflow-y: auto;
    z-index: 20;
}

.custom-dropdown-menu.show { display: flex; }

/* ── 상태 효과 요약 ── */
.status-effect-summary {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed var(--border-color);
}

.status-effect-title {
    margin: 0 0 12px 0;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--accent-color);
}

.status-effect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
}

.status-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card-bg);
    padding: 14px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.status-icon-img {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
}

.status-text {
    font-size: 0.82em;
    line-height: 1.45;
    color: var(--text-sub);
    word-break: keep-all;
}

.status-text strong {
    display: block;
    color: var(--text-color);
    margin-bottom: 3px;
    font-size: 1.05em;
}

/* ══════════════════════════════════════════════════════════════════
 * 카드 · 리스트 · 위젯
 * ══════════════════════════════════════════════════════════════════ */
/* =========================================
   새로운 스킬 상시 리스트 뷰 스타일
   ========================================= */
/* 스킬 리스트 컨테이너 */
.skill-list-container {
    width: 100%;
    max-width: 800px;
    background: transparent;
    padding-bottom: 20px;
    box-sizing: border-box;
    position: relative;
}

.skill-list-item {
    position: relative;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--active-color);
    box-shadow: var(--shadow-sm);
    line-height: 1.5;
    animation: slideIn 0.2s ease-out;
    scroll-margin-top: calc(20px + env(safe-area-inset-top, 0px));
}

/* 스킬 이름 제목 스타일 */
.skill-list-item strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 1.1em;
    border-bottom: 1px solid var(--overlay-strong);
    padding-bottom: 6px;
}

.skill-list-item p {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-color);
    line-height: 1.6;
}

/* =========================================
   On-demand 빈 상태 워터마크
   ========================================= */
.skill-empty-watermark {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 70px 20px;
    color: var(--text-sub);
    opacity: 0.45;
    text-align: center;
}

.skill-empty-watermark svg {
    width: 46px;
    height: 46px;
    stroke: var(--text-sub);
}

.skill-empty-watermark p {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.6;
    font-weight: 500;
}

.summary-quest-badge {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* 스킬 박스 우측 상단 컨트롤 (고정 토글 + 제거 버튼) */
.skill-box-controls {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.skill-pin-label {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.7em;
    color: var(--text-sub);
}

.skill-remove-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-sub);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.skill-remove-btn:active {
    background: var(--danger-color);
    color: #fff;
    border-color: var(--danger-color);
}

/* 컨트롤과 겹치지 않도록 제목 줄에 우측 여백 확보 */
.skill-list-item strong { padding-right: 90px; }

/* ── 상태 박스 (요약) ── */
.status-box {
    background: var(--overlay-strong);
    padding: 10px 12px;
    border-radius: 5px;
    margin-top: 10px;
    font-size: 0.88em;
    border-left: 3px solid var(--accent-color);
    color: var(--text-color);
}

/* =========================================
   공지사항 (하단, index/js/site.js — Firestore notices 최신 4개)
   - 정적 카드, footer 바로 위에 둠
   ========================================= */
.notice-box {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--border-color);
    border-radius: var(--radius);
    margin: 10px auto 0 auto;
    box-shadow: none;
}

.notice-header {
    padding: 10px 14px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-sub);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notice-content {
    padding: 0 14px 14px 14px;
    font-size: 0.8em;
    color: var(--text-sub);
    line-height: 1.6;
    opacity: 0.9;
}

/* ── 변경된 공지사항 리스트 스타일 ── */
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* 각 줄 사이 여백 */
    margin: 0;
    padding: 0;
}

.notice-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 0;
    font: inherit;
    text-align: left;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}
.notice-log-btn { padding: 0; font: inherit; color: var(--active-color); font-size: 0.9em; background: none; border: none; cursor: pointer; }

.notice-item-left {
    flex: 1;
    color: var(--text-color);
    line-height: 1.5;
    word-break: keep-all;
    font-size: 1em;
}

.notice-item-right {
    flex-shrink: 0;
    color: var(--text-sub);
    opacity: 0.8;
    font-size: 0.9em;
    white-space: nowrap;
    padding-top: 1px;
    /* 텍스트 높이 보정 */
}

/* 전체 변경 로그 팝업(계정 처리방침 팝업 .ac-pv 틀을 같이 씀) */
.site-log .cl-scroll { flex: 1; overflow-y: auto; padding: 4px 18px 24px; -webkit-overflow-scrolling: touch; }
.cl-month { margin: 18px 0 8px; font-size: 0.95em; color: var(--accent-color); }
.cl-item { padding: 10px 12px; margin-bottom: 8px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; }
.cl-item.focus { border-color: var(--accent-color); }
.cl-head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9em; }
.cl-head span { flex: none; color: var(--text-sub); }
.cl-body { margin: 8px 0 0; padding-left: 18px; font-size: 0.82em; line-height: 1.7; color: var(--text-sub); }
.cl-sub { margin: 10px 0 0; font-size: 0.86em; font-weight: 700; color: var(--text-color); }
.cl-sub + .cl-body { margin-top: 4px; }
.cl-sub-list { margin: 0; padding-left: 16px; list-style: circle; }
.cl-empty { margin: 24px 0; text-align: center; font-size: 0.85em; color: var(--text-sub); }

/* 공지 로딩 실패 시 안내 문구 */
.notice-content.notice-error {
    color: var(--danger-color);
    opacity: 0.75;
}

/* =========================================
   하단 위젯 래퍼 & 통계 위젯
   ========================================= */
.bottom-widgets-wrap {
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin: 40px auto 0 auto;
    padding-top: 30px;
    border-top: 1px dashed var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 기존 notice-box 스타일 덮어쓰기 (래퍼 안에서 꽉 차게) */
.bottom-widgets-wrap .notice-box { margin: 0; }

/* 📊 통계 위젯 스타일 */
.stats-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--active-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    user-select: none;
}

.stats-widget:active {
    transform: scale(0.98);
    background: var(--border-color);
}

.stats-widget-header {
    padding: 10px 14px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
}

.stats-link {
    color: var(--active-color);
    font-size: 0.85em;
}

.stats-widget-body { padding: 14px; }

/* 위젯 내부 수치 박스 스타일 */
.stats-summary-grid {
    display: flex;
    gap: 10px;
}

.stats-stat-box {
    flex: 1;
    background: var(--overlay-weak);
    border: 1px solid var(--overlay-strong);
    border-radius: 6px;
    padding: 12px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-label {
    font-size: 0.75em;
    color: var(--text-sub);
    font-weight: bold;
}

.stats-value {
    font-size: 1.4em;
    font-weight: 900;
    color: var(--accent-color);
    font-family: 'Cinzel', sans-serif;
}

.stats-value small {
    font-size: 0.5em;
    font-weight: normal;
    margin-left: 2px;
    color: var(--text-sub);
    font-family: 'Noto Sans KR', sans-serif;
}

.skill-list-item.target-focus { animation: skill-target-highlight 1.5s ease-out; }

.vk-icon-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    font-size: 1.15em;
    line-height: 1;
    color: var(--text-sub);
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}

/* 초기화 버튼 전용 붉은색 스타일 */
.vk-icon-btn.vk-reset-btn { color: var(--danger-color); }

.vk-icon-btn.vk-reset-btn:active {
    background: rgba(166, 61, 64, 0.1);
    border-color: var(--danger-color);
}

.vk-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vk-icon-btn:active { background: var(--border-color); }
.vk-keyboard-toggle .icon-close { display: none; }
.vk-keyboard-toggle.is-open .icon-search { display: none; }
.vk-keyboard-toggle.is-open .icon-close { display: block; }

/* 키보드가 열려있을 때 검색 토글 버튼 강조 (현재 상태 표시) */
.vk-keyboard-toggle.is-open {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* 초성/알파벳 타일 그리드 - 기본은 접힘, 검색 토글을 누르면 펼쳐짐 */
.vk-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, margin-bottom 0.25s ease;
}

.vk-tile-grid.open {
    max-height: 38vh;
    overflow-y: auto;
    margin-bottom: 8px;
}

/* 영문 정렬일 때는 열을 조금 더 늘려서 26자를 더 촘촘히 배치 */
.vk-tile-grid.lang-en { grid-template-columns: repeat(5, 1fr); }

.vk-tile {
    padding: 8px 4px;
    font-size: 1em;
    font-weight: 700;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    cursor: pointer;
    text-align: center;
    transition: transform 0.1s ease, background 0.1s ease;
}

.vk-tile:active {
    transform: scale(0.93);
    background: var(--accent-color);
    color: #fff;
}

/* 💬 초성 탭 시 키보드 바로 위에 뜨는 스킬 선택 팝업 (말풍선) */
.vk-skill-popup {
    display: none;
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 100%;
    margin-bottom: 8px;
    max-height: 44vh;
    overflow-y: auto;
    background: var(--bg-color);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* 팝업 표시 시 Grid 레이아웃 공통 적용 */
.vk-skill-popup.show {
    display: grid;
    gap: 6px;
    align-content: start;
    animation: popUp 0.15s ease-out;
}

/* 영문일 때 2열 */
.vk-skill-popup.show.lang-en { grid-template-columns: repeat(2, 1fr); }

/* 한글일 때 3열 */
.vk-skill-popup.show.lang-ko { grid-template-columns: repeat(3, 1fr); }

/* ----------------------------------------
   팝업 헤더 (타이틀 + 퀘스트 범례)
   ---------------------------------------- */
.vk-popup-title-wrap {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2px;
    padding-bottom: 6px;
}

.vk-popup-title {
    font-size: 1.1em;
    font-weight: 900;
    color: var(--active-color);
    line-height: 1;
}

.quest-legend-popup {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--text-sub);
}

.quest-legend-popup svg {
    width: 13px;
    height: 13px;
    fill: var(--accent-color);
    transform: translateY(-1px);
}

.vk-popup-item {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 700;
    color: var(--text-color);
    cursor: pointer;
    word-break: keep-all;
    /* 단어가 잘리지 않게 줄바꿈 */
}

.vk-popup-item:active { background: var(--border-color); }

/* ----------------------------------------
   퀘스트 스킬 마크 (진하게 + 텍스트 겹침 방지)
   ---------------------------------------- */
.vk-popup-item-quest {
    /* fill 값을 %239C7A3C (진한 골드색/accent-color)로 변경하여 선명하게 만듦 */
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg' fill='%239C7A3C'%3E%3Cpath d='M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm14 3c0 .6-.4 1-1 1H6c-.6 0-1-.4-1-1v-1h14v1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 6px center;
    background-size: 14px;
    padding-left: 22px;
}

/* ----------------------------------------
   🧮 EP 계산기 팝업 - 난이도/인원/모드 설정 + 결과 카드만 담음
   (vk-skill-popup 컨테이너를 재사용하되 세로 폼 레이아웃으로 오버라이드).
   숫자 키패드는 이 팝업 밖에 있음 - 아래 .vk-ep-keypad-grid 참고.
   ---------------------------------------- */
.vk-ep-popup.show {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: none;
    overflow: visible;
}

.ep-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.ep-mode-tabs {
    display: flex;
    gap: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2px;
}

.ep-mode-btn {
    padding: 4px 10px;
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-sub);
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
}

.ep-mode-btn.active {
    background: var(--accent-color);
    color: #fff;
}

.ep-settings-row {
    display: flex;
    gap: 10px;
}

.ep-setting-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ep-setting-group label {
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-sub);
}

.ep-seg {
    display: flex;
    gap: 4px;
}

.ep-seg button {
    flex: 1;
    padding: 7px 4px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.ep-seg button {
    white-space: nowrap;
}

@media (max-width: 360px) {
    .ep-setting-group:first-child { flex: 1.6; }
    .ep-seg { gap: 3px; }
    .ep-seg button { padding: 7px 2px; font-size: 0.8em; }
}

.ep-seg button.active {
    background: var(--active-color);
    color: #fff;
    border-color: var(--active-color);
}

.ep-mode-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ep-input-label {
    font-size: 0.75em;
    font-weight: 700;
    color: var(--text-sub);
}

/* 현재 파티 XP 표시창 (계산기 화면처럼 우측 정렬) */
.ep-xp-display {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 1.4em;
    font-weight: 900;
    text-align: right;
    letter-spacing: 1px;
    font-family: 'Cinzel', serif;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.ep-xp-display.empty {
    color: var(--text-sub);
    opacity: 0.55;
}

/* ----------------------------------------
   🧮 EP 계산기 숫자 키패드 - 초성 검색 키보드(.vk-tile-grid)와 동일한 방식으로
   패널 배경에서 그대로 확장되어 올라오는 느낌을 주기 위해 같은 클래스를 재사용함.
   (플로팅 팝업인 .vk-ep-popup과 달리 테두리/그림자 없는 패널의 일부로 보임)
   ---------------------------------------- */
.vk-ep-keypad-grid { grid-template-columns: repeat(3, 1fr); }

.vk-ep-keypad-grid .ep-xp-display-wrap {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 2px;
}

.ep-key {
    padding: 8px 4px;
    font-size: 1em;
    font-weight: 700;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.1s ease;
}

.ep-key:active {
    background: var(--accent-color);
    color: #fff;
    transform: scale(0.93);
}

.ep-key-clear {
    color: var(--danger-color);
    font-weight: 900;
}

.ep-key-clear:active {
    background: rgba(166, 61, 64, 0.12);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.ep-key-backspace { color: var(--text-sub); }

.ep-key-backspace:active {
    background: var(--border-color);
    color: var(--text-color);
}

.ep-key-backspace svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 계산 결과는 키패드(패널 배경에 녹아드는 느낌)와 달리 카드로 분리해 보이도록 함 */
.ep-result {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 8px 10px;
    min-height: 24px;
}

.ep-placeholder {
    font-size: 0.85em;
    color: var(--text-sub);
    text-align: center;
    padding: 4px 0;
}

.ep-total {
    font-size: 1.15em;
    font-weight: 900;
    color: var(--active-color);
    margin-bottom: 2px;
}

.ep-formula-note {
    font-size: 0.75em;
    color: var(--text-sub);
    margin-bottom: 8px;
}

.ep-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ep-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--chip-color);
    background: var(--card-bg);
    border: 1.5px solid var(--chip-color);
    border-radius: 20px;
}

/* EP 계산기 토글 버튼이 열려있을 때 강조 (키보드 토글과 동일한 스타일 언어) */
.vk-ep-toggle.is-open {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

/* ── 일반 네비 버튼 ── */
.nav-btn {
    background: none;
    border: none;
    color: var(--active-text);
    opacity: 0.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    padding: 2px 2px; 
    transition: color var(--transition), transform var(--transition);
    flex: 1;
    gap: 3px;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

.nav-btn svg { width: 20px; height: 20px; }
.nav-btn span { font-size: 9px; font-weight: 700; letter-spacing: 0.5px; font-family: 'Noto Sans KR', sans-serif; }
.nav-btn:hover { color: var(--active-text); opacity: 1; }
.nav-btn:active { color: #FFF; transform: scale(0.88); }

/* 활성 인디케이터 (1층 영역으로 끌어올림) */
.nav-btn.is-current { color: var(--accent-color); opacity: 1; }
.nav-btn.is-current::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    border-radius: 4px;
    background: var(--accent-color);
}

/* ── 가운데 로고 버튼 (요철/FAB 스타일) ── */
.nav-btn.nav-home {
    flex: 0 0 auto;
    width: 60px;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    opacity: 1;
    position: relative;
}

.nav-btn.nav-home:active {
    transform: none; 
}

.nav-btn.nav-home::after {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--nav-solid-bg);
    z-index: 0; 
}

.nav-btn.nav-home .nav-home-icon-wrap {
    margin-top: -5px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition);
    z-index: 1; 
}

/* 내부 아이콘 래퍼만 눌림 효과 적용 */
.nav-btn.nav-home:active .nav-home-icon-wrap { transform: scale(0.85); }
.nav-btn.nav-home .icon-close { display: none; }

/* 로고 스타일링 */
.nav-btn.nav-home .icon-logo {
    width: 42px; 
    height: auto;
    filter: invert(48%) sepia(60%) saturate(400%) hue-rotate(5deg) brightness(0.85);
    transition: transform 0.2s;
}

/* 모달 열림(닫기 모드) 상태 */
.nav-btn.nav-home.mode-close .icon-logo { display: none; }
.nav-btn.nav-home.mode-close .icon-close { 
    display: block; 
    width: 30px; 
    height: 30px; 
}

/* 닫기 상태일 때 투명 배경 유지, X 아이콘만 붉은색으로 표시 */
.nav-btn.nav-home.mode-close .nav-home-icon-wrap {
    background: transparent;
    color: var(--danger-color);
}

/* =========================================
   정기점검 팝업 전용 스타일
   ========================================= */
.maint-modal-wrap { z-index: 6000; }
.maint-modal-box { border: 2px solid var(--accent-color); }

.maint-modal-title {
    color: var(--danger-color);
    margin-bottom: 15px;
}

.maint-modal-msg {
    white-space: pre-line;
    text-align: left;
    font-size: 0.9em;
    line-height: 1.6;
    background: var(--overlay-weak);
    padding: 12px;
    border-radius: 6px;
    font-weight: 500;
    word-break: keep-all;
}

.maint-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

/* ────────────────────────────────────────
 * 바텀 시트 (지역 정보 / 업데이트 로그 공용)
 * ──────────────────────────────────────── */
/* 오버레이(배경): 평소에는 display: none과 opacity: 0으로 완벽히 숨김 */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--nav-h, 64px);
    background: rgba(0, 0, 0, 0.55);
    z-index: 4000;
    display: none;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.25s ease-out;
}

/* active 세팅 시 투명도 회복 */
.bottom-sheet-overlay.show { opacity: 1; }

/* 바텀 시트 박스: 평소에는 화면 아래(100%)로 내려가 숨겨져 있음 */
.bottom-sheet-box {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: 100%;
    max-width: 800px;
    /* 핵심: 배경색을 위/아래 두 가지로 분리합니다 */
    background-color: var(--card-bg); /* 1. 하단 홈 인디케이터 및 스크롤 바운스 색상 */
    background-image: linear-gradient(var(--bg-color), var(--bg-color)); 
    background-size: 100% 50vh; /* 2. 상단 노치를 포함한 위쪽 절반만 bg-color로 덮기 */
    background-repeat: no-repeat;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding-top: env(safe-area-inset-top);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 부모 오버레이가 열릴 때 부드럽게 위로 미끄러져 올라옴 */
.bottom-sheet-overlay.show .bottom-sheet-box { transform: translateY(0); }

/* 모바일 상단 핸들 바 (터치 영역 확장 적용) */
.bottom-sheet-handle {
    display: none;
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: 12px auto 12px auto;
    flex-shrink: 0;
    position: relative;
}

.bottom-sheet-handle::before {
    content: '';
    position: absolute;
    top: -15px;
    bottom: -15px;
    left: -30px;
    right: -30px;
}

.bottom-sheet-box iframe {
    width: 100%;
    flex: 1;
    border: none;
    background: var(--bg-color);
}

.iframe-full {
    width: 100%;
    height: 100%;
    flex: 1;
}

/* 홈 화면에 추가 안내 바텀시트 — 짧은 텍스트 안내라 다른
   바텀시트(iframe, 높이 100dvh 고정)와 달리 내용물 높이에 맞춰 접히는
   compact 수정자를 씀. */
.bottom-sheet-box.compact {
    top: auto;
    height: auto;
    max-height: 80dvh;
    /* compact는 화면 아래쪽 일부만 차지해서 노치까지 안 닿으므로 상단 안전영역
       패딩이 불필요 — 기본 .bottom-sheet-box의 padding-top을 취소함 */
    padding-top: 0;
}

.install-guide-content {
    padding: 20px 20px 8px 20px;
    overflow-y: auto;
    color: var(--text-color);
}

.install-guide-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    color: var(--accent-color);
}

.install-guide-desc {
    margin: 0 0 12px 0;
    font-size: 0.92em;
    line-height: 1.6;
    color: var(--text-sub);
}

.install-guide-steps {
    margin: 0 0 12px 0;
    padding-left: 22px;
    font-size: 0.95em;
    line-height: 1.9;
}

.install-guide-note {
    margin: 0;
    font-size: 0.82em;
    line-height: 1.5;
    color: var(--text-sub);
}

.install-guide-cta {
    display: block;
    width: 100%;
    padding: 14px;
    margin: 4px 0 12px 0;
    font-size: 1.05em;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: #fff;
    background: var(--accent-color);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.install-guide-cta:active { filter: brightness(0.9); }

.btn-text-underline {
    background: transparent;
    border: none;
    color: var(--text-sub);
    text-decoration: underline;
    font-size: 0.85em;
    cursor: pointer;
    padding: 5px;
}

/* 푸터 링크 */
.footer-link {
    color: var(--text-color);
    text-decoration: underline;
    display: inline-block;
}

.footer-link.mt-6 { margin-top: 6px; }

/* ══════════════════════════════════════════════════════════════════
 * 계정 (헤더 계정 버튼 → 계정 바텀 시트, index/js/account.js)
 * ══════════════════════════════════════════════════════════════════ */
.account-sheet-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-color);
}

.account-content {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px 20px 32px;
    color: var(--text-color);
}

.ac-title { margin: 0 0 14px; font-size: 1.1em; color: var(--accent-color); }

.ac-avatar {
    position: relative;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    object-fit: cover;
}
span.ac-avatar::after {
    content: '';
    position: absolute;
    inset: 6px;
    background: var(--text-sub);
    -webkit-mask: url(../../assets/party-size.svg) center / contain no-repeat;
    mask: url(../../assets/party-size.svg) center / contain no-repeat;
}
.ac-avatar.sm { width: 22px; height: 22px; }
span.ac-avatar.sm::after { inset: 3px; }

.ac-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font: 700 0.95em 'Noto Sans KR', sans-serif;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
}
.ac-btn.primary { color: #fff; background: var(--accent-color); border-color: var(--accent-color); }
.ac-btn.danger { color: var(--danger-color); background: transparent; border-color: var(--danger-color); }
.ac-btn:disabled { opacity: 0.6; cursor: default; }

.ac-row { display: flex; gap: 8px; margin-top: 12px; }
.ac-row .ac-btn { flex: 1; }

.ac-or { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; font-size: 0.8em; color: var(--text-sub); }
.ac-or::before, .ac-or::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }

.ac-field { display: block; margin-bottom: 10px; }
.ac-field span { display: block; margin-bottom: 4px; font-size: 0.82em; font-weight: 700; color: var(--text-sub); }
.ac-field .keyword-input { width: 100%; box-sizing: border-box; font-size: 16px; }

.ac-link {
    display: block;
    margin: 10px auto 0;
    padding: 5px;
    font-size: 0.85em;
    color: var(--text-sub);
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}
.ac-link.danger { color: var(--danger-color); }

.ac-desc { margin: 14px 0 0; font-size: 0.8em; line-height: 1.6; color: var(--text-sub); }
.ac-desc a { color: var(--accent-color); }

.ac-msg {
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 0.88em;
    line-height: 1.5;
    background: var(--card-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
}

.ac-warn {
    margin-bottom: 12px;
    padding: 10px 12px;
    font-size: 0.85em;
    line-height: 1.5;
    border: 1px solid var(--danger-color);
    border-radius: 8px;
}
.ac-warn .ac-btn { margin-top: 8px; padding: 8px; font-size: 0.85em; }

.ac-me { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; }
.ac-me b { display: block; font-size: 0.95em; word-break: break-all; }
.ac-me small { font-size: 0.78em; color: var(--text-sub); }

.ac-sep { height: 1px; margin: 16px 0 6px; background: var(--border-color); }

.ac-me + .ac-terms { margin-top: 12px; }
.ac-admin-btn { margin-top: 12px; }
.ac-adm h4 { margin: 18px 0 10px; font-size: 0.95em; color: var(--accent-color); }
.ac-adm h4:first-of-type { margin-top: 4px; }
.account-content:has(.ac-adm) { max-width: 760px; }
.ac-adm .keyword-input { width: 100%; box-sizing: border-box; }
.ac-adm textarea.keyword-input { width: 100%; box-sizing: border-box; min-height: 12em; font: 16px/1.5 'Noto Sans KR', sans-serif; resize: vertical; }
.ac-adm-edit textarea.keyword-input { min-height: 18em; }
.ac-adm-edit { min-width: 0; }
.ac-adm-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ac-adm-grid .keyword-input { min-width: 0; }
.ac-adm-grid .ac-field { margin-bottom: 10px; }
.ac-adm-state { margin: 0 0 10px; font-size: 0.8em; color: var(--text-sub); }
.ac-adm-state b { color: var(--accent-color); }
.ac-adm .ac-check { margin: 4px 0 10px; }
.ac-adm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ac-adm-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 0.85em; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; }
.ac-adm-row > span { flex: 1; min-width: 0; }
.ac-adm-row small { color: var(--text-sub); margin-left: 6px; }
.ac-adm-row .ac-btn { flex: none; width: auto; padding: 6px 10px; font-size: 0.85em; }
.ac-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-size: 0.85em; color: var(--text-sub); }
.ac-pager .ac-btn { width: auto; padding: 6px 14px; }
.ac-adm-edit { padding: 12px; border: 1px solid var(--accent-color); border-radius: 8px; }
.ac-pv { position: fixed; inset: 0; z-index: 7000; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.55); }
.ac-pv.show { display: flex; }
.ac-pv-wide .ac-pv-box { max-width: 1100px; height: 94vh; height: 94dvh; }
.ac-pv-box { display: flex; flex-direction: column; width: 100%; max-width: 720px; height: min(86vh, 900px); height: min(86dvh, 900px); overflow: hidden; background: var(--bg-color); border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,0.35); }
.ac-pv-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--border-color); color: var(--accent-color); }
.ac-pv-close { width: 32px; height: 32px; font-size: 1em; color: var(--text-sub); background: none; border: none; cursor: pointer; }
.ac-pv-frame { flex: 1; width: 100%; border: 0; background: var(--bg-color); }
.ac-lead { margin: 0 0 12px; font-size: 0.86em; color: var(--text-color); }
.ac-back { margin: 0 0 12px; padding: 0; font: 700 0.85em 'Noto Sans KR', sans-serif; color: var(--accent-color); background: none; border: none; cursor: pointer; }
.ac-terms { padding: 12px 14px; font-size: 0.8em; line-height: 1.6; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 8px; }
.ac-terms ul { margin: 6px 0 8px; padding-left: 18px; color: var(--text-sub); }
.ac-terms a { color: var(--accent-color); }
.ac-check { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 14px; font-size: 0.88em; line-height: 1.5; cursor: pointer; }
.ac-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent-color); }
.ac-check b { color: var(--accent-color); }
.ac-signup { transition: opacity 0.2s; }
.ac-signup.dim { opacity: 0.45; }
.ac-pwrules { margin: -2px 0 12px; padding-left: 18px; font-size: 0.78em; line-height: 1.7; color: var(--text-sub); }
.ac-pwrules li.ok { color: var(--accent-color); }
.ac-pwrules li.ok::after { content: ' ✓'; }
.ac-pwrules li.bad { color: var(--danger-color); }
.ac-join { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-color); font-size: 0.85em; color: var(--text-sub); }
.ac-join span { flex: 1; }
.ac-join .ac-btn { flex: none; width: auto; padding: 9px 18px; }
.ac-help { margin: 8px 0 0; padding-left: 18px; font-size: 0.92em; line-height: 1.6; }
.ac-field .ac-inline { display: flex; gap: 8px; margin: 0; font-size: 1em; font-weight: 400; }
.ac-inline .keyword-input { flex: 1; min-width: 0; width: auto; margin: 0; }
.ac-inline .ac-btn { flex: none; width: auto; padding: 0 16px; }
.ac-inline .ac-advname { flex: 1; min-width: 0; align-self: center; font-size: 1em; font-weight: 700; color: var(--text-color); word-break: break-all; }
.ac-inline .ac-advname.none { font-weight: 400; color: var(--text-sub); }
.ac-tag { margin-left: 3px; font-size: 0.88em; font-weight: 400; color: var(--text-sub); opacity: 0.7; }
.ac-tagrow { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: -2px 0 10px; }
.ac-tagrow .ac-btn { flex: none; width: auto; padding: 8px 14px; font-size: 0.85em; }
.ac-tagnote { flex-basis: 100%; min-width: 0; font-size: 0.78em; line-height: 1.4; color: var(--text-sub); }
.ac-hint { margin: -4px 0 12px; font-size: 0.78em; line-height: 1.5; color: var(--text-sub); }
.ac-switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 0 4px; border-top: 1px solid var(--border-color); }
.ac-switch-row > span { flex: 1; }
.ac-switch-row b { display: block; font-size: 0.9em; }
.ac-switch-row small { display: block; margin-top: 3px; font-size: 0.78em; line-height: 1.5; color: var(--text-sub); }
.ac-switch-row .toggle-switch { flex: none; }
.ac-switch-row .ac-btn { flex: none; width: auto; padding: 8px 16px; font-size: 0.85em; }
.ac-switch-row[hidden] { display: none; }
.ac-switch-row .settings-new-badge { margin-left: 6px; }
.ac-games { padding: 12px 0; border-top: 1px solid var(--border-color); }
.ac-games > b { display: block; font-size: 0.9em; }
.ac-games > small { display: block; margin: 3px 0 6px; font-size: 0.78em; line-height: 1.5; color: var(--text-sub); }
.ac-games-row .ac-inline { align-items: center; }
.ac-inline .ac-gamesum { font-size: 0.9em; font-weight: 400; line-height: 1.5; }
.ac-games-page { border-top: 0; padding-top: 0; }
.ac-games-page > small { margin-bottom: 8px; }
.ac-games-page .ac-row { margin-top: 12px; }
.ac-game { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 2px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ac-game:disabled { cursor: default; opacity: 0.75; }
.ac-game-box { flex: none; width: 18px; height: 18px; border: 2px solid var(--border-color); border-radius: 4px; box-sizing: border-box; position: relative; }
.ac-game.on .ac-game-box { background: var(--accent-color); border-color: var(--accent-color); }
.ac-game.on .ac-game-box::after { content: ''; position: absolute; left: 4px; top: 0; width: 4px; height: 9px; border: solid var(--bg-color); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ac-game-name { font-size: 0.9em; }
.ac-game-name small { margin-left: 6px; font-size: 0.85em; color: var(--text-sub); }
.ac-settings { margin-top: 18px; }
.ac-sec { margin: 0 0 6px; font-size: 0.95em; color: var(--accent-color); }
.ac-sec-note { margin-left: 6px; font-size: 0.8em; font-weight: 400; color: var(--text-sub); }
.ac-me .ac-me-out { flex: none; width: auto; margin-left: auto; padding: 8px 14px; font-size: 0.85em; }
.ac-me > span { min-width: 0; }
.ac-settings .ac-field { margin-top: 8px; }
.ac-settings .ac-switch-row:last-child { padding-bottom: 12px; }

.ac-withdraw { margin-top: 10px; padding: 12px; border: 1px solid var(--danger-color); border-radius: 8px; }
.ac-withdraw b { color: var(--danger-color); }
.ac-withdraw p { margin: 6px 0 10px; font-size: 0.8em; line-height: 1.6; color: var(--text-sub); }

/* 헤더 오른쪽 버튼 = 계정 이미지 원형 버튼(Google 프로필 사진, 없으면 party-size.svg). 아직 안 본 안내가 있으면 NEW 점 */
.settings-avatar-btn { position: relative; border-radius: 50%; overflow: hidden; }
.settings-avatar-btn.has-new::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--danger-color);
    z-index: 1;
}
.settings-avatar-btn .ac-avatar.hd {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    border: none;
    background: transparent;
}
span.ac-avatar.hd::after { inset: 8px; }
.settings-avatar-btn:hover span.ac-avatar.hd::after,
.settings-avatar-btn:active span.ac-avatar.hd::after { background: #fff; }


/* ────────────────────────────────────────
 * 14. 스킬 찾기 설정 + 적 칩 스캐너 (index/js/chip-scan.js)
 * ──────────────────────────────────────── */
.settings-seg { display: inline-flex; flex-shrink: 0; border: 1px solid var(--accent-color); border-radius: 999px; overflow: hidden; }
.settings-seg button {
    padding: 5px 11px;
    font-size: 0.78em;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: var(--accent-color);
    background: transparent;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.settings-seg button + button { border-left: 1px solid var(--accent-color); }
.settings-seg button.active { background: var(--accent-color); color: var(--card-bg); }
.settings-seg button:disabled { opacity: 0.4; cursor: default; }
.skver-row { width: 100%; max-width: 800px; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; padding: 0 1px; }
.skver-label { font-size: 0.88em; font-weight: 700; color: var(--text-sub); white-space: nowrap; }
.skver-row .settings-seg button { min-height: 30px; min-width: 48px; padding-top: 0; padding-bottom: 0; font-size: 0.82em; }
.ac-theme-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ac-theme-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 1px solid var(--border-color); border-radius: 10px; background: var(--card-bg); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.ac-theme-opt.on { border-color: var(--accent-color); box-shadow: 0 0 0 1px var(--accent-color) inset; }
.ac-theme-dot { flex: none; width: 18px; height: 18px; border: 2px solid var(--border-color); border-radius: 50%; box-sizing: border-box; position: relative; }
.ac-theme-opt.on .ac-theme-dot { border-color: var(--accent-color); }
.ac-theme-opt.on .ac-theme-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent-color); }
.ac-theme-intro { margin: 0 0 10px; font-size: 0.78em; line-height: 1.5; color: var(--text-sub); }
.ac-theme-name { font-size: 0.92em; font-weight: 700; }
.ac-theme-name small { margin-left: 4px; font-size: 0.82em; font-weight: 400; color: var(--text-sub); }
.settings-note { margin: -4px 0 0; padding: 0 2px 8px; font-size: 0.75em; line-height: 1.5; color: var(--text-sub); }
.settings-note[hidden] { display: none; }
.vk-icon-btn[hidden] { display: none; }

.chipscan {
    position: fixed;
    inset: 0;
    z-index: 5500;
    background: #000;
    color: #fff;
    overflow: hidden;
    display: block;
    touch-action: none;
}
.chipscan[hidden] { display: none; }
.chipscan.no-cam .chipscan-guide, .chipscan.no-cam .chipscan-hint { display: none; }
.chipscan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.chipscan-guide {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 60vmin;
    height: 60vmin;
    transform: translate(-50%, -50%);
    border: 3px dashed rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.chipscan-hint {
    position: absolute;
    left: 0;
    right: 0;
    top: max(18px, env(safe-area-inset-top));
    text-align: center;
    font-size: 1em;
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}
.chipscan-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 44vh;
    overflow-y: auto;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 78%, rgba(0, 0, 0, 0));
    display: flex;
    flex-direction: column;
    gap: 8px;
    touch-action: pan-y;
}
.chipscan-prep { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); overflow: hidden; flex-shrink: 0; }
.chipscan-prep[hidden] { display: none; }
.chipscan-prep-bar { height: 100%; width: 0; background: var(--accent-color, #D4A94E); transition: width 0.2s; }
.chipscan-status { font-size: 0.85em; text-align: center; color: rgba(255, 255, 255, 0.85); flex-shrink: 0; min-height: 1.3em; }
.chipscan-err { padding: 10px; font-size: 0.82em; line-height: 1.6; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 8px; flex-shrink: 0; }
.chipscan-err[hidden] { display: none; }
.chipscan-err p { margin: 0 0 8px; }
.chipscan-results { display: flex; flex-direction: column; gap: 6px; }
.chipscan-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: rgba(255, 255, 255, 0.12); border-radius: 8px; }
.chipscan-chip { width: 36px; height: 36px; flex-shrink: 0; object-fit: contain; }
.chipscan-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 0.82em; line-height: 1.35; }
.chipscan-info b { font-size: 1.05em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chipscan-info span { color: rgba(255, 255, 255, 0.78); }
.chipscan-info .chipscan-miss { color: #ffb4a8; }
.chipscan-alt-btn, .chipscan-btn {
    flex-shrink: 0;
    padding: 7px 12px;
    font-size: 0.8em;
    font-weight: 700;
    font-family: 'Noto Sans KR', sans-serif;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    cursor: pointer;
}
.chipscan-close { width: 100%; padding: 11px; font-size: 0.95em; color: var(--card-bg, #fff); background: var(--accent-color, #D4A94E); border-color: transparent; border-radius: 8px; }
.chipscan-alts { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px; }
.chipscan-alt { display: flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; font-size: 0.8em; font-family: 'Noto Sans KR', sans-serif; color: #fff; background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 8px; cursor: pointer; }
.chipscan-alt img { width: 28px; height: 28px; object-fit: contain; }

/* 모험가 내비 아이콘 — assets/party-size.svg를 글자색(활성 색 포함)으로 칠함 */
.nav-btn .nav-icon-mask {
    display: block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    -webkit-mask: url("../../assets/party-size.svg") center / contain no-repeat;
    mask: url("../../assets/party-size.svg") center / contain no-repeat;
}
