/* 게임 안 팝업 공통 틀(2026-11-08) — 내 라켓 · 내 콕 · 급수표 · 자판기 · 용품점 · 확성기 · 운영자 공지 · 팀 맺기 · 문의 · 후원이 모두 이 틀을 쓴다.
 *
 * <div class="pop" id="…">                        ← 어두운 바깥(톡 하면 닫힘). 열기: .on 붙이기(또는 hidden 빼기)
 *   <div class="pop-box" role="dialog">            ← 흰 카드. --pc(머리 색) · --pc-ink(머리 글자 색) · --pop-w(최대 폭)로 꾸민다
 *     <div class="pop-head">                       ← 색 머리띠: 제목(+ 작은 설명) · 오른쪽에 콕 지갑 · ✕ 닫기
 *       <div class="pop-titles"><h2 class="pop-title">제목</h2><small class="pop-sub">설명</small></div>
 *       <span class="pop-wallet"><img src="img/shuttle.png" alt=""><span>1,234</span></span>   (있을 때만)
 *       <button class="pop-x" type="button" aria-label="닫기"></button>
 *     </div>
 *     <div class="pop-tabs"><button class="on">탭</button>…</div>     (있을 때만 — 용품점, 앞으로 라커룸)
 *     <div class="pop-preview">…</div>                                (있을 때만 — 캐릭터·물건 미리보기 자리)
 *     <div class="pop-body">…</div>                ← 내용. 길면 여기만 스크롤(머리·아래 버튼은 늘 보인다)
 *     <div class="pop-foot"><button class="pop-btn">…</button><button class="pop-btn primary">…</button></div>
 *   </div>
 * </div>
 *
 * 테마: 카드에 style="--pc:#e0483e" 처럼 색만 주면 머리띠 · 탭 · 주 버튼 색이 같이 바뀐다. */
.pop {
  position: fixed; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(29, 29, 27, .45); font-family: inherit;
}
.pop.on { display: flex; }
.pop[hidden] { display: none; }
.pop-box {
  --pc: #1a7f4b; --pc-ink: #fff; --pc-soft: color-mix(in srgb, var(--pc) 10%, #fff);
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--pop-w, 400px); max-height: 100%; box-sizing: border-box; overflow: hidden;
  border-radius: 22px; background: #fff; color: var(--ink, #1d1d1b); box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
  animation: popIn .22s cubic-bezier(.3, 1.3, .5, 1);
}
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@media (prefers-reduced-motion: reduce) { .pop-box { animation: none; } }

/* 머리띠: 왼쪽 제목 · 오른쪽 지갑과 ✕ */
.pop-head { flex: none; display: flex; align-items: center; gap: 10px; min-height: 58px; box-sizing: border-box; padding: 10px 10px 10px 18px; background: var(--pc); color: var(--pc-ink); }
.pop-titles { flex: 1; min-width: 0; }
.pop-title { margin: 0; font-size: 20px; font-weight: 900; line-height: 1.25; letter-spacing: -.01em; color: inherit; }
.pop-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; line-height: 1.35; opacity: .9; }
.pop-wallet { flex: none; display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: #1a7f4b;
  font-weight: 900; font-size: 16px; font-variant-numeric: tabular-nums; }
.pop-wallet img { width: 18px; transform: rotate(-10deg); }
.pop-x { flex: none; position: relative; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: inherit;
  cursor: pointer; touch-action: manipulation; }
.pop-x::before, .pop-x::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 2.5px; margin: -1.25px 0 0 -8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }
.pop-x::after { transform: rotate(-45deg); }
.pop-x:active { transform: scale(.9); }

/* 탭: 머리띠 바로 아래 한 줄 */
.pop-tabs { flex: none; display: flex; gap: 6px; padding: 10px 12px 0; }
.pop-tabs button { flex: 1; font: inherit; font-size: 14px; font-weight: 800; padding: 9px 0; border: 1.5px solid #eee6d6; border-radius: 10px; background: #fbf7ef; color: var(--ink, #1d1d1b);
  touch-action: manipulation; cursor: pointer; }
.pop-tabs button.on { background: var(--pc); border-color: var(--pc); color: var(--pc-ink); }

/* 미리보기: 캐릭터·물건을 크게 보여 주는 자리(라커룸 · 깃털 개인화 · 장비 해금) */
.pop-preview { flex: none; position: relative; margin: 10px 12px 0; min-height: 120px; border-radius: 16px; background: var(--pc-soft); border: 1px solid rgba(29, 29, 27, .06); overflow: hidden;
  display: flex; align-items: center; justify-content: center; }

/* 내용: 길면 여기만 스크롤 */
.pop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 12px 14px 4px; }
.pop-body:last-child { padding-bottom: 16px; }
/* 안내 한 줄(사고 나면 잠깐 초록 굵은 글씨로 바뀐다) */
.pop-how { margin: 0 2px; min-height: 19px; font-size: 13px; line-height: 1.45; color: var(--ink, #1d1d1b); }
.pop-how.msg { color: #1a7f4b; font-weight: 800; }
.pop-h3 { margin: 14px 2px 4px; font-size: 14px; font-weight: 900; color: var(--ink, #1d1d1b); }

/* 아래 버튼 줄: 기본 회색 · .primary 는 머리띠 색. 보이는 버튼이 없으면 줄째 숨는다 */
.pop-foot { flex: none; display: flex; gap: 8px; padding: 10px 14px 14px; }
.pop-foot:not(:has(> :not([hidden]))) { display: none; }
.pop-btn { flex: 1; min-height: 46px; font: inherit; font-size: 15px; font-weight: 800; padding: 11px 10px; border: 0; border-radius: 13px; background: #eceae4; color: var(--ink, #1d1d1b);
  cursor: pointer; touch-action: manipulation; }
.pop-btn.primary { flex: 1.6; background: var(--pc); color: var(--pc-ink); }
.pop-btn:active { transform: scale(.97); }
.pop-btn:disabled { opacity: .4; }
.pop-btn[hidden] { display: none; }

/* 폰(좁은 화면): 여백을 줄이고 글자를 살짝 */
@media (max-width: 420px) {
  .pop { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .pop-head { min-height: 54px; padding-left: 16px; }
  .pop-title { font-size: 19px; }
  .pop-body { padding-left: 12px; padding-right: 12px; }
  .pop-foot { padding-left: 12px; padding-right: 12px; }
}
/* 낮은 화면(폰 가로): 머리띠를 얇게 */
@media (max-height: 480px) {
  .pop-head { min-height: 46px; padding-top: 6px; padding-bottom: 6px; }
  .pop-sub { display: none; }
  .pop-foot { padding-top: 8px; padding-bottom: 10px; }
}
