/* EverPlanet 코디마법사 스타일 (game_hub 셸 내부) */
.gh-ep { max-width: 1180px; margin: 0 auto; padding: 16px; position: relative; }
.gh-ep__ver {
  position: absolute; top: 8px; left: 10px; z-index: 5;
  font-size: 11px; opacity: .55; letter-spacing: .2px;
}
.gh-ep__ver b { opacity: .85; }

/* 성별전환 확인 모달 */
.ep-modal__ov {
  position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5);
}
.ep-modal {
  background: #1b1d26; color: #eee; border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px; padding: 22px 24px; max-width: 340px; width: 86%;
  box-shadow: 0 12px 40px rgba(0,0,0,.5); text-align: center;
}
.ep-modal__msg { font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }
.ep-modal__btns { display: flex; gap: 10px; justify-content: center; }
.ep-modal__ok, .ep-modal__cancel {
  border: 0; border-radius: 10px; padding: 9px 22px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.ep-modal__ok { background: var(--gh-accent, #5b8cff); color: #fff; }
.ep-modal__cancel { background: rgba(127,127,127,.22); color: inherit; }
.gh-ep__head { text-align: center; margin-bottom: 14px; }
.gh-ep__title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.gh-ep__sub { font-size: 13px; opacity: .7; margin: 0; }

/* 듀얼 화면 토글 바 */
.gh-ep__modebar { display: flex; justify-content: flex-end; max-width: 1180px; margin: 0 auto 8px; }
.ep-modebtn {
  background: rgba(127,127,127,.14); border: 0; border-radius: 8px;
  padding: 6px 14px; color: inherit; cursor: pointer; font-size: 13px; font-weight: 600;
}
.ep-modebtn.on { background: var(--gh-accent, #5b8cff); color: #fff; }

/* 듀얼 모드: 좌 캐릭터 / 우 아이템 패널 나란히 */
.gh-ep--dual .gh-ep__body {
  display: flex; gap: 24px; align-items: flex-start; max-width: 1180px; margin: 0 auto;
}
.gh-ep--dual .gh-ep__main { flex: 0 0 auto; margin-bottom: 0; position: sticky; top: 12px; }
.gh-ep--dual .gh-ep__panel { flex: 1 1 auto; min-width: 0; }
.gh-ep--dual .gh-ep__grid { max-height: 72vh; overflow-y: auto; padding-right: 4px; }

@media (max-width: 900px) {
  .gh-ep__modebar { display: none; }                 /* 좁은 화면: 듀얼 토글 숨김 */
  .gh-ep--dual .gh-ep__body { display: block; }       /* 좁으면 듀얼 무효(단일) */
  .gh-ep--dual .gh-ep__main { position: static; }
  .gh-ep--dual .gh-ep__grid { max-height: none; overflow: visible; }
}

/* 좌 슬롯 | 중앙(캐릭터) | 우 슬롯 */
.gh-ep__main {
  display: flex; align-items: flex-start; justify-content: center; gap: 14px;
  margin: 8px 0 18px;
}
.gh-ep__center { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gh-ep__slots { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }

/* 장착 슬롯 셀 */
.ep-slot {
  position: relative; width: 66px; display: flex; flex-direction: column; align-items: center;
  gap: 3px; cursor: pointer; padding: 4px; border-radius: 10px; border: 2px solid transparent;
  transition: background .12s, border-color .12s;
}
.ep-slot:hover { background: rgba(127,127,127,.1); }
.ep-slot.active { border-color: var(--gh-accent, #5b8cff); background: rgba(91,140,255,.1); }
.ep-slot__icon {
  width: 50px; height: 50px; border-radius: 10px; background-color: rgba(127,127,127,.12);
  background-repeat: no-repeat; background-position: left center; background-size: auto 100%;
  border: 1px dashed rgba(127,127,127,.4);
}
.ep-slot__icon.filled { border-style: solid; border-color: rgba(127,127,127,.5); }
.ep-slot__label { font-size: 11px; opacity: .8; white-space: nowrap; }
.ep-slot__x {
  position: absolute; top: 0; right: 0; width: 18px; height: 18px; line-height: 16px;
  border: 0; border-radius: 50%; background: #e2483d; color: #fff; font-size: 13px;
  cursor: pointer; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.4);
}
/* 무기 슬롯 (캐릭터 아래 가로) */
.gh-ep__wslots { display: flex; gap: 12px; justify-content: center; }
.gh-ep__wslots .ep-slot { width: 80px; }

/* 무기 직업 필터 */
.gh-ep__jobs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 12px; }
.ep-jobpill {
  background: rgba(127,127,127,.14); color: inherit; border: 0; border-radius: 999px;
  padding: 5px 11px; font-size: 12px; cursor: pointer;
}
.ep-jobpill:hover { background: rgba(127,127,127,.26); }
.ep-jobpill.on { background: var(--gh-accent, #5b8cff); color: #fff; }
.ep-jobhint { font-size: 12px; opacity: .6; padding: 5px 0; }
.ep-slot.disabled { opacity: .4; }

/* 아이템 이름 검색 */
.gh-ep__search { position: relative; max-width: 320px; margin: 0 auto 12px; }
.ep-search {
  width: 100%; box-sizing: border-box; padding: 8px 30px 8px 12px;
  border-radius: 999px; border: 1px solid rgba(127,127,127,.35);
  background: rgba(127,127,127,.1); color: inherit; font-size: 13px;
}
.ep-search:focus { outline: none; border-color: var(--gh-accent, #5b8cff); }
.ep-search__clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(127,127,127,.3); color: inherit; cursor: pointer; font-size: 13px; line-height: 1;
}

@media (max-width: 720px) {
  .gh-ep__main { gap: 6px; }
  .ep-slot { width: 52px; }
  .ep-slot__icon { width: 40px; height: 40px; }
  .ep-slot__label { font-size: 10px; }
}

.gh-ep__stage-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.gh-ep__controls { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.ep-ctlrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.ep-ctlrow__label { font-size: 12px; opacity: .65; margin-right: 4px; min-width: 30px; }
.ep-pill {
  background: rgba(127,127,127,.14); color: inherit; border: 0; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; transition: background .15s;
}
.ep-pill:hover { background: rgba(127,127,127,.26); }
.ep-pill.on { background: var(--gh-accent, #5b8cff); color: #fff; }
.ep-ctl {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(127,127,127,.12); border-radius: 8px; padding: 4px 10px; font-size: 12px;
}
.ep-ctl select {
  background: rgba(127,127,127,.15); color: inherit; border: 1px solid rgba(127,127,127,.3);
  border-radius: 6px; padding: 3px 6px; font-size: 12px;
}

.gh-ep__stage {
  width: 460px; max-width: 92vw; aspect-ratio: 1 / 1;
  background: #0e0f16; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.gh-ep__stage canvas { width: 100%; height: 100%; display: block; }

/* 머리색 스와치 (캐릭터 바로 아래) */
.gh-ep__dye {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  max-width: 460px; margin: 2px auto 0;
}
.ep-dye__sw {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer; padding: 0;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  border: 2px solid rgba(127,127,127,.35);
  box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .1s, border-color .1s;
}
.ep-dye__sw:hover { transform: scale(1.12); }
.ep-dye__sw.on { border-color: var(--gh-accent, #5b8cff); border-width: 3px; }

.gh-ep__actions { display: flex; gap: 10px; }
.gh-ep__btn {
  background: var(--gh-accent, #5b8cff); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.gh-ep__btn--ghost { background: rgba(127,127,127,.18); color: inherit; }

.gh-ep__tabs {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px;
}
.ep-tab {
  background: rgba(127,127,127,.14); color: inherit; border: 0; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; cursor: pointer; transition: background .15s;
}
.ep-tab:hover { background: rgba(127,127,127,.25); }
.ep-tab.on { background: var(--gh-accent, #5b8cff); color: #fff; }

/* 도구줄: 검색 + 뷰토글 */
.gh-ep__toolbar { display: flex; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.gh-ep__toolbar .gh-ep__search { margin: 0; }
.gh-ep__view { display: flex; gap: 4px; }
.ep-viewbtn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(127,127,127,.35);
  background: rgba(127,127,127,.1); color: inherit; cursor: pointer; font-size: 15px; line-height: 1;
}
.ep-viewbtn.on { background: var(--gh-accent, #5b8cff); color: #fff; border-color: transparent; }

/* 아이콘 그리드 (기본) */
.gh-ep__grid {
  display: grid; grid-template-columns: repeat(auto-fill, 64px); gap: 8px;
  justify-content: center; max-width: 900px; margin: 0 auto;
}
.ep-item {
  position: relative; width: 64px; cursor: pointer;
  border-radius: 10px; border: 2px solid transparent; transition: border-color .12s;
}
.ep-item__icon {
  width: 100%; height: 60px; background-color: rgba(127,127,127,.1);
  /* _n(250x40)에서 왼쪽 정사각(아이콘)만 노출 */
  background-repeat: no-repeat; background-position: left center; background-size: auto 100%;
  border-radius: 8px; position: relative;
}
.ep-item__name { display: none; }
.ep-item:hover { border-color: rgba(127,127,127,.4); }
.ep-item.on { border-color: var(--gh-accent, #5b8cff); }

/* 목록 보기 (2~3열, 아이콘+이름) */
.gh-ep__grid--list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  max-width: 760px; gap: 6px;
}
.gh-ep__grid--list .ep-item {
  width: auto; display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; background: rgba(127,127,127,.08); border-radius: 10px;
}
.gh-ep__grid--list .ep-item__icon { width: 42px; height: 42px; flex: 0 0 42px; }
.gh-ep__grid--list .ep-item__name {
  display: block; font-size: 12.5px; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gh-ep__grid--list .ep-item.on { background: rgba(91,140,255,.15); }

/* 성별 배지 (썸네일 우상단) */
.ep-badge {
  position: absolute; top: 2px; right: 2px;
  font-size: 9px; line-height: 1; font-weight: 700;
  padding: 2px 4px; border-radius: 5px; color: #fff;
  pointer-events: none; box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.ep-badge--man { background: #3b82f6; }
.ep-badge--woman { background: #ec4899; }
.ep-badge--common { background: rgba(90,90,100,.85); }

/* 롤오버 툴팁 */
.ep-tip {
  position: fixed; z-index: 9999; transform: translate(-50%, -100%);
  display: flex; align-items: center; gap: 6px;
  background: #14151c; color: #fff; border: 1px solid rgba(255,255,255,.12);
  padding: 5px 9px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,.45); pointer-events: none;
}
.ep-tip__name { font-weight: 600; }
.ep-tip__g { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 999px; color: #fff; }
.ep-tip__g--man { background: #3b82f6; }
.ep-tip__g--woman { background: #ec4899; }
.ep-tip__g--common { background: rgba(120,120,130,.9); }

@media (max-width: 520px) {
  .gh-ep__grid { grid-template-columns: repeat(auto-fill, 56px); }
  .ep-item { width: 56px; }
  .ep-item__icon { height: 52px; }
  .gh-ep__grid--list { grid-template-columns: 1fr; }
}
