/* 브랜드 시그니처: 하늘색 그라데이션 + 흰 글자 (버튼 전용), 말풍선은 연한 톤 + 진한 글자 */
:root {
  --bg: #f7f7f8; --card: #ffffff; --line: #e9e9ec;
  --text: #191919; --sub: #8c8c94;
  --accent: #3ba7ee; --accent-text: #ffffff; --link: #3c86c9;
  --accent-grad: linear-gradient(135deg, #54c2f9, #2f7fe0);
  --danger: #e5484d;
  --chat-bg: #ccd7e1;
  --bubble-me: linear-gradient(180deg, #eaf6fe, #cfe7fb); --bubble-me-text: #1c2732;
  --bubble-you: #ffffff; --bubble-you-text: #191919;
  --shop-badge-bg: #2f7fe0; --shop-badge-fg: #ffffff;
}
:root[data-theme="dark"] {
  --bg: #17171b; --card: #222227; --line: #32323a;
  --text: #ececef; --sub: #9a9aa3;
  --accent: #4fb6f2; --accent-text: #ffffff; --link: #7ea4e8;
  --accent-grad: linear-gradient(135deg, #4fb6f2, #2b6fc4);
  --danger: #e5484d;
  --chat-bg: #232b36;
  --bubble-me: linear-gradient(180deg, #25516f, #1c405a); --bubble-me-text: #ddeefa;
  --bubble-you: #2e333b; --bubble-you-text: #ececef;
  --shop-badge-bg: #ffffff; --shop-badge-fg: #2f7fe0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
/* PC 에서는 좁은 폰 기둥 대신 넓은 화면으로 (대표 지시).
   앱 골격 폭은 전부 --shell 을 따르므로 여기 한 곳만 바꾸면 된다. */
@media (min-width: 900px) {
  :root { --shell: 820px; }
  body { box-shadow: 0 0 0 1px var(--line), 0 10px 60px rgba(0, 0, 0, .12); }
}
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, "Pretendard", "Noto Sans KR", sans-serif;
  max-width: var(--shell, 480px); margin: 0 auto;
}
.hidden { display: none !important; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--card);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: 100%;
}

/* ---------- 가입 게이트 ---------- */
#gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.gate-card { width: 100%; max-width: 400px; text-align: center; }
.gate-card h1 { font-size: 32px; letter-spacing: -1px; }
.tagline { color: var(--sub); margin: 6px 0 16px; }
.notice { font-size: 11.5px; color: var(--sub); line-height: 1.6; margin: 2px 0 0; }
#signupForm { display: flex; flex-direction: column; gap: 10px; text-align: left; }
#signupForm .row { display: flex; gap: 10px; }
.check { font-size: 14px; display: flex; gap: 8px; align-items: center; color: var(--text); }
.check input { width: auto; }
.primary {
  background: var(--accent-grad); color: var(--accent-text); border-radius: 12px;
  padding: 14px; font-weight: 700; width: 100%;
}
.fine { font-size: 11px; color: var(--sub); margin-top: 12px; }
.linklike { color: var(--link); font-size: 13px; margin-top: 14px; text-decoration: underline; }
.chip19 {
  display: inline-block; border: 1px solid var(--danger); color: var(--danger);
  border-radius: 5px; font-size: 10px; font-weight: 800; padding: 1px 5px;
  vertical-align: 1px; margin-right: 4px;
}

/* ---------- 탈 선택 ---------- */
.mask-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mask-opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px 7px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--card); font-size: 11.5px; color: var(--text);
}
.mask-opt img { width: 52px; height: 52px; border-radius: 13px; }
.mask-opt.on { border-color: var(--accent); background: var(--bg); font-weight: 700; }
.mask-prem { font-style: normal; font-size: 9px; color: #b8860b; font-weight: 700; }
/* 가입 화면의 사전가입 한정 캐릭터 — 탈과 같은 문법이되 인물 사진이라 세로로 길게 */
.char-pick .mask-opt img { width: 100%; height: auto; aspect-ratio: 4/5; object-fit: cover; border-radius: 12px; }
.char-pick .mask-prem { color: var(--sub); font-weight: 600; }
#charPickLabel b { color: var(--accent); }
#charPickNote { margin: 6px 2px 0; }
.mask-pop { width: min(100%, 360px); display: flex; flex-direction: column; gap: 12px; }
.mask-pop b { font-size: 16px; }
/* 채팅 헤더 🎭 — 상대가 원본 사진을 공개해 준 상태 표시 */
.play-btn.on { background: var(--accent-grad); border-color: transparent; }

/* ---------- 가면 씌우기 에디터 ---------- */
.mask-ed { width: min(100%, 380px); display: flex; flex-direction: column; gap: 10px; }
.mask-ed b { font-size: 16px; }
.mask-ed #edCanvas {
  align-self: center; border-radius: 14px; border: 1px solid var(--line);
  touch-action: none; cursor: grab; max-width: 100%;
}
.mask-ed input[type="range"] { width: 100%; accent-color: var(--accent); padding: 0; border: 0; }
.mask-ed .ed-row { grid-template-columns: repeat(3, 1fr); }
.mask-ed .ed-row .mask-opt img { width: 72px; height: 36px; object-fit: contain; border-radius: 0; }
.ed-btns { justify-content: flex-end; }

/* 내 사진첩: 가면 버전이 있는 사진 표시 */
.photos .mask-badge {
  position: absolute; right: 4px; bottom: 4px; font-size: 13px;
  background: rgba(0,0,0,.55); border-radius: 8px; padding: 1px 5px;
}

/* 원본 사진 공개 시트 */
.reveal-pop { width: min(100%, 340px); display: flex; flex-direction: column; gap: 10px; text-align: left; }
.reveal-pop > b { font-size: 16px; }
.rv-row { font-size: 13.5px; color: var(--sub); }
.rv-row b { color: var(--text); }
.reveal-pop .chip { width: 100%; padding: 11px; }

/* ---------- 관심사 칩 ---------- */
.int-label { font-size: 12px; color: var(--sub); margin-top: 2px; }
.int-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.int-chip {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; background: var(--card); color: var(--text);
}
.int-chip.on { background: var(--accent-grad); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.int-chip.small { padding: 3px 10px; font-size: 11px; }
.int-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; padding: 4px 16px 0; }

/* ---------- 메인 레이아웃 ---------- */
#main { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#topbar {
  padding: 12px 16px; font-weight: 700; font-size: 18px;
  border-bottom: 1px solid var(--line); background: var(--bg);
  display: flex; align-items: center; justify-content: space-between;
}
.tb-btns { display: flex; gap: 6px; }
#themeBtn, #soloMatgoBtn {
  font-size: 17px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 5px 11px;
}
#themeBtn { font-size: 19px; line-height: 1; color: var(--text); }
#content { flex: 1; overflow-y: auto; }
#tabbar {
  display: flex; border-top: 1px solid var(--line); background: var(--bg);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabbar button {
  flex: 1; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; font-size: 18px; color: var(--sub); position: relative;
}
#tabbar button span { font-size: 10px; }
#tabbar button.active { color: var(--text); font-weight: 700; }
/* 썸네일은 어디서든 눌러서 프로필을 볼 수 있다 — 손모양 커서로 표시 */
.avatar, .msg-avatar, .note-avatar { cursor: pointer; }

.badge {
  position: absolute; top: 4px; right: 22%; background: var(--danger); color: #fff;
  font-size: 10px; font-style: normal; border-radius: 9px; padding: 1px 5px; min-width: 16px;
}

/* ---------- 사람들 ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0;
}
.filters.row2 { padding: 8px 12px 10px; }
/* 오른쪽 여백은 드롭다운 화살표 자리 — 좁히면 글자가 화살표 아래로 파고든다.
   한 줄에 넷을 넣으면 그 자리를 빼고 나면 글자가 잘리므로 두 개씩 줄바꿈한다. */
.filters select {
  padding: 7px 22px 7px 8px; width: auto;
  flex: 1 1 calc(50% - 3px); min-width: 0;
  font-size: 13px; border-radius: 9px; text-overflow: ellipsis;
}
.filters .chip { flex: 0 0 auto; font-size: 13px; padding: 7px 10px; white-space: nowrap; }
.filters .fsearch { flex: 1 1 60px; min-width: 0; }
.person {
  display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
  align-items: center; width: 100%; text-align: left;
}
.avatar {
  width: 52px; height: 52px; border-radius: 14px; background: var(--card);
  object-fit: cover; flex-shrink: 0; display: flex; align-items: center;
  justify-content: center; font-size: 24px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person .info { flex: 1; min-width: 0; }
.person .name { font-weight: 700; }
.person .meta { font-size: 12px; color: var(--sub); margin-top: 2px; }
.person .intro { font-size: 13px; color: var(--sub); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person .ago { font-size: 11px; color: var(--sub); flex-shrink: 0; }
.online { color: #3ddc84; }

/* ---------- 리스트 공통 ---------- */
.section-title { padding: 14px 16px 6px; font-size: 13px; color: var(--sub); font-weight: 700; }
/* 데모 성별 전환 안내 — 시연 계정에서만 보인다 */
.demo-banner { margin: 10px 14px 2px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px;
  line-height: 1.5; background: #fff5d6; color: #6b4e00; border: 1px solid #f0d98a; }
.demo-banner b { color: #8a5a00; }
[data-theme='dark'] .demo-banner { background: #3a2f10; color: #f2dfa8; border-color: #5c4a18; }
[data-theme='dark'] .demo-banner b { color: #ffd977; }
.empty { padding: 40px 16px; text-align: center; color: var(--sub); font-size: 14px; }
.rowbtns { display: flex; gap: 8px; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; font-size: 13px;
}
.chip.accent { background: var(--accent-grad); border-color: var(--accent); color: var(--accent-text); font-weight: 700; }
.chip.danger { color: var(--danger); border-color: var(--danger); }

/* ---------- 채팅 ---------- */
#profileView { z-index: 12; }   /* 채팅창 안에서 썸네일을 눌러도 프로필이 위로 뜨게 */
.overlay { position: fixed; inset: 0; background: var(--bg); z-index: 10;
  max-width: var(--shell, 480px); margin: 0 auto; display: flex; flex-direction: column; }
.ov-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.ov-head .name { font-weight: 700; flex: 1; }
.msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column;
  gap: 8px; background: var(--chat-bg); }
/* 첫 메시지가 상단에 딱 붙지 않게 이모지 하나 정도의 여백을 두고 시작 */
.msgs > :first-child { margin-top: 34px; }
/* 네이버 장소 추천 리스트 (시트 안) */
.sheet-body .place-row { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.place-row b { font-size: 14px; }
.place-row small { color: var(--sub); font-size: 11.5px; font-weight: 400; }

/* 대화 중 장소 추천 제안 (테마당 1번) */
.place-hint {
  align-self: center; max-width: 90%; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; font-size: 12.5px; color: var(--sub);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.bubble { max-width: 75%; padding: 10px 13px; border-radius: 16px; font-size: 14px;
  line-height: 1.45; word-break: break-word; }
/* 꼬리 없는 균일한 라운드 — 카톡식 말풍선 모양과 확실히 구분 */
.bubble.me { align-self: flex-end; background: var(--bubble-me); color: var(--bubble-me-text); }
.bubble.you { align-self: flex-start; background: var(--bubble-you); color: var(--bubble-you-text);
  box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.bubble time { display: block; font-size: 10px; opacity: .6; margin-top: 4px; }
.composer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line);
  padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.composer input { flex: 1; }
.composer button { background: var(--accent-grad); color: var(--accent-text); border-radius: 10px; padding: 0 18px; font-weight: 700; }

/* ---------- 프로필 ---------- */
.profile-card { padding: 20px 16px; text-align: center; }
.profile-card .avatar { width: 88px; height: 88px; margin: 0 auto 10px; font-size: 40px; border-radius: 24px; }
.profile-card h2 { font-size: 20px; }
.profile-card .meta { color: var(--sub); font-size: 13px; margin: 4px 0 10px; }
/* 소개글 — 본문 기본 16px 상속으로 이름보다 튀었다. 보조 정보 크기로 */
.profile-card p { font-size: 14px; color: var(--text); opacity: .85; margin: 2px auto 8px; max-width: 44ch; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 0 16px 16px; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--card); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
/* 삭제 버튼 — 손가락으로 정확히 누를 수 있어야 하므로 넉넉히 잡는다.
   같은 자리를 쓰는 🎯 는 삭제 모드에서 렌더되지 않는다 (app.js 참고) */
.photos .del { position: absolute; top: 5px; right: 5px; z-index: 2;
  background: var(--danger); color: #fff; border-radius: 50%;
  width: 30px; height: 30px; font-size: 15px; font-weight: 800; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .35); border: 2px solid #fff; }
.photos .del:active { transform: scale(.9); }
/* 삭제 모드임이 사진 자체에서도 보이게 — 잘못 누르는 사고를 줄인다 */
.photos .ph.erasing img { filter: brightness(.72); }
.photos .add { display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: 10px; aspect-ratio: 1;
  color: var(--sub); font-size: 24px; width: 100%; }
.actions { display: flex; gap: 8px; justify-content: center; padding: 0 16px 20px; flex-wrap: wrap; }

/* ---------- 설정 ---------- */
.set-item { display: block; width: 100%; text-align: left; padding: 14px 16px;
  border-bottom: 1px solid var(--line); font-size: 15px; }
.set-item.danger { color: var(--danger); }
.set-desc { font-size: 12px; color: var(--sub); margin-top: 3px; }

/* ---------- 광고 배너 (AdMob/AdSense 자리) ---------- */
.ad-banner {
  height: 50px; display: flex; align-items: center; justify-content: center;
  background: var(--card); color: var(--sub); font-size: 12px;
  border-top: 1px solid var(--line); letter-spacing: 1px;
}

/* ---------- 미니게임 카드 ---------- */
.gamecard {
  align-self: center; width: 90%; max-width: 320px; background: var(--card);
  color: var(--text); border-radius: 16px; padding: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1); cursor: default;
}
.g-title { font-weight: 800; font-size: 13px; color: var(--sub); }
.g-opts { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.g-opt {
  flex: 1; padding: 11px 8px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); font-size: 13.5px; line-height: 1.35;
}
.g-opt.picked { background: var(--accent-grad); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
.g-vs { font-size: 11px; font-weight: 800; color: var(--sub); flex-shrink: 0; }
.g-progress { text-align: center; font-size: 11px; font-weight: 800; color: var(--sub); margin-top: 10px; }
.g-round {
  display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; margin-top: 6px;
  background: var(--bg); border-radius: 9px; font-size: 12px; text-align: left;
}
.g-round span { color: var(--sub); }
.g-round b { font-size: 12.5px; }
.g-round small { color: var(--sub); font-size: 11px; }
.g-again {
  display: block; width: 100%; margin-top: 10px; padding: 11px;
  background: var(--accent-grad); color: var(--accent-text); border-radius: 10px;
  font-weight: 700; font-size: 13.5px;
}
.g-status { font-size: 12.5px; color: var(--sub); margin-top: 10px; text-align: center; }
.g-cho { font-size: 30px; font-weight: 800; letter-spacing: 8px; text-align: center; margin: 10px 0 2px; }
.g-hint { text-align: center; font-size: 12px; color: var(--sub); }
.g-quiz-row { display: flex; gap: 6px; margin-top: 10px; }
.g-quiz-in { flex: 1; padding: 9px 10px; font-size: 14px; }
.g-quiz-btn { background: var(--accent-grad); color: var(--accent-text); border-radius: 9px; padding: 0 14px; font-weight: 700; }
.g-pct { font-size: 42px; font-weight: 800; text-align: center; color: #e8590c; margin: 6px 0 2px; }
.g-common { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin: 6px 0 0; }
.g-saju { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 10px; }
.g-saju-head { font-weight: 800; font-size: 13.5px; }
.g-saju-head b { color: #e8590c; font-size: 15px; }
.g-saju-btn {
  display: block; width: 100%; margin-top: 8px; padding: 11px;
  background: var(--accent-grad); color: var(--accent-text); border-radius: 10px;
  font-weight: 700; font-size: 13.5px;
}
.g-saju-row { margin-top: 8px; text-align: left; }
.g-saju-row .g-rel { font-size: 12.5px; font-weight: 700; }
.g-saju-row p { font-size: 12px; color: var(--sub); margin: 2px 0 0; line-height: 1.5; }
.g-steps {
  margin-top: 8px; text-align: center; font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--text); letter-spacing: 1px; line-height: 1.7;
}
.g-privacy {
  margin-top: 10px; padding: 8px 10px; background: var(--bg); border-radius: 9px;
  font-size: 11px; color: var(--sub); line-height: 1.55; text-align: left;
}
.g-parts { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.g-part { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--sub); }
.g-part span { flex: 0 0 66px; }
.g-part b { flex: 0 0 34px; text-align: right; color: var(--text); }
.g-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.g-bar i { display: block; height: 100%; background: #e8590c; border-radius: 3px; }
.gamecard time { display: block; font-size: 10px; color: var(--sub); margin-top: 10px; text-align: right; }

/* ---------- 맞고 ---------- */
#matgoView { background: radial-gradient(120% 90% at 50% 32%, #3fb257, #28a044 62%, #1e8636); z-index: 30; }
#matgoView .ov-head { background: var(--bg); }
#mgSound { font-size: 16px; }
.mg-board {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto; gap: 7px;
  padding: 0 10px; padding-bottom: max(10px, env(safe-area-inset-bottom));
}

/* 화투장 (이미지) */
.hw { padding: 0; border: 0; background: none; position: relative; width: 42px; flex-shrink: 0; }
.hw .hwsvg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.hw-mon {
  position: absolute; top: 3px; left: 3px; background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 8.5px; font-weight: 800; font-style: normal; border-radius: 4px;
  padding: 0 3px; line-height: 1.5; pointer-events: none;
}
.capcards .hw-mon { display: none; }   /* 작은 카드에선 배지 생략 */
.hw[data-i]:not([disabled]) { cursor: pointer; transition: transform .12s; }
.hw[data-i]:not([disabled]):hover { transform: translateY(-6px); }
.hw[disabled] { opacity: 1; cursor: default; }   /* 전역 button:disabled 흐림 무시 */
.mg-hand .hw[disabled] { opacity: .55; }         /* 내 차례가 아닐 때 손패만 흐림 */
/* 먹을 수 있는 패 표시 (노란 ▼) */
.hw-arrow {
  position: absolute; top: -15px; left: 50%; color: #ffd400; font-size: 15px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6); pointer-events: none;
  animation: arrowBob .6s ease-in-out infinite alternate;
}
@keyframes arrowBob {
  from { transform: translate(-50%, 0); }
  to { transform: translate(-50%, 5px); }
}

/* 상대 손패 — 상단에서 카드 절반쯤 늘어뜨린 뒷면 */
.mg-slivers { display: flex; gap: 5px; padding: 0 2px; min-height: 30px; }
.mg-slivers .sliv {
  flex: 0 0 32px; height: 29px; overflow: hidden;
  border-radius: 0 0 6px 6px; box-shadow: 0 3px 4px rgba(0, 0, 0, .35);
}
.mg-slivers .sliv .hwsvg { width: 100%; display: block; }

/* 먹은 패 — 실전처럼 서로 공개, 묶음 + 수량 배지 */
.mg-caps { display: flex; gap: 13px; flex-wrap: wrap; min-height: 40px; padding: 2px 2px 4px; }
.capgrp { position: relative; }
.capcards { display: flex; position: relative; }
.capcards .hw { width: 27px; margin-left: -9px; }
.capcards .hw:first-child { margin-left: 0; }
.cap-badge {
  position: absolute; right: -5px; bottom: -5px; background: #131313; color: #fff;
  font-size: 10.5px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.mg-none { color: #86ac92; font-size: 11px; align-self: center; }
/* 획득 순간 반짝 연출 */
.capgrp.burst::after {
  content: ''; position: absolute; inset: -12px; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 65%);
  animation: burstFx .7s ease-out forwards;
}
@keyframes burstFx {
  from { opacity: 1; transform: scale(.4); }
  to { opacity: 0; transform: scale(1.6); }
}

/* 정보 줄 (이름 · 점수(기본x배) · n고) */
.mg-info { display: flex; align-items: center; gap: 8px; padding: 3px 8px; color: #fff; border-radius: 10px; border: 2px solid transparent; }
.mg-info.turn { border-color: rgba(255, 225, 77, .9); background: rgba(0, 0, 0, .2); }
.mg-info b { font-size: 14px; }
.mg-turnmark {
  font-style: normal; font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 8px;
  background: rgba(255, 255, 255, .92); color: #b03325; animation: actPulse .9s infinite alternate;
}
.mg-turnmark.me { background: #ffe14d; color: #191919; }
.mg-pts { color: #ffe14d; font-weight: 800; font-size: 13.5px; }
.mg-go {
  font-style: normal; background: rgba(0, 0, 0, .4); color: #ffb1a8;
  font-size: 11px; font-weight: 800; border-radius: 6px; padding: 2px 7px;
}
.mg-auto {
  margin-left: auto; background: #fff; color: #222; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; padding: 5px 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.mg-auto[disabled] { opacity: .5; }

/* 바닥: 같은 월 겹쳐 쌓기 + 중앙 더미(패산) */
.mg-table {
  flex: 1; display: flex; flex-wrap: wrap; gap: 12px 15px; align-items: center;
  align-content: center; justify-content: center; position: relative;
  min-height: 150px; padding: 8px 0;
}
.mg-fstack { display: flex; }
.mg-fstack .hw { width: 40px; }
.mg-fstack .hw + .hw { margin-left: -15px; margin-top: 18px; }   /* 먹힌 두 장이 다 보이게 비껴 쌓기 */
.mg-deckwrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 10px; }
.mg-multbadge {
  background: rgba(0, 0, 0, .45); color: #ffe14d; font-size: 14px; font-weight: 900;
  border-radius: 999px; padding: 3px 12px; letter-spacing: 1px;
}
.mg-deck { position: relative; width: 52px; margin-bottom: 10px; }
.mg-deck .hwsvg {
  width: 100%; filter: none; border-radius: 6px;
  box-shadow: var(--dsh, 0 4px 8px rgba(0, 0, 0, .35));   /* 남은 장수만큼 두껍게 */
}
.mg-deck.empty .hwsvg { opacity: .22; box-shadow: none; }
.mg-deck b {
  position: absolute; right: -7px; bottom: -9px; background: #131313; color: #fff;
  font-size: 11px; font-weight: 800; border-radius: 5px; padding: 1px 6px;
}
/* 연출 배너 (뻑/쪽/따닥/폭탄/싹쓸이/N고) */
.mg-banner {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 36; pointer-events: none; animation: bannerFx .85s ease-out forwards;
}
.mg-banner img { max-width: 230px; max-height: 120px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.mg-banner span {
  display: block; background: rgba(0, 0, 0, .78); color: #ffe14d; font-size: 18px;
  font-weight: 900; border-radius: 12px; padding: 10px 18px; white-space: nowrap;
}
.mg-banner.big span {
  font-size: 27px; padding: 14px 26px; border: 3px solid #ffe14d;
  border-radius: 16px; box-shadow: 0 8px 26px rgba(0, 0, 0, .45);
}
@keyframes bannerFx {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(.95); }
}

/* 흔들기/폭탄 버튼, 나가리 승계 표시, 폭탄패 */
.mg-act {
  background: #d13b2f; color: #fff; border-radius: 999px;
  font-size: 12.5px; font-weight: 800; padding: 5px 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); animation: actPulse 1s infinite alternate;
}
@keyframes actPulse { from { transform: scale(1); } to { transform: scale(1.07); } }
.mg-carry {
  font-style: normal; font-size: 11px; font-weight: 800; vertical-align: 2px;
  background: #d13b2f; color: #fff; border-radius: 6px; padding: 2px 7px; margin-left: 6px;
}
.hw-bombicon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 65%; pointer-events: none; }
.mg-gj-title { display: block; max-width: 100%; margin: 10px auto 0; }
.mg-gj-card { text-align: center; margin-top: 10px; }
.mg-gj-card img { width: 84px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.mg-shake-cards { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.mg-shake-cards .hw { width: 56px; }

/* 방금 낸/뒤집은 카드 팝 — 먹었으면 먹은 카드들을 부채꼴로 펼쳐 보여준다 */
.mg-pop {
  position: absolute; left: 50%; top: 50%; display: flex; gap: 3px;
  pointer-events: none; z-index: 3; animation: popFx .95s ease-out forwards;
  perspective: 520px;
}
/* 누가 낸 카드인지 이름표 */
.pop-who {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 800; white-space: nowrap;
  background: rgba(255, 255, 255, .95); color: #b03325; border-radius: 999px; padding: 2px 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .3);
}
.mg-pop.from-me .pop-who { background: #ffe14d; color: #191919; }
/* 더미 뒤집기: 뒷면 → 앞면 공개 (두근두근) */
.mg-pop .flipcard { position: relative; transform-style: preserve-3d; animation: flipReveal .5s ease-out .12s both; }
.flipcard i { display: block; backface-visibility: hidden; }
.flipcard .f-front { position: absolute; inset: 0; transform: rotateY(180deg); }
@keyframes flipReveal { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
.mg-pop.from-deck { animation-name: popFx; animation-duration: 1.05s; }
/* 딜링: 패가 착착착 깔린다 */
.deal-hidden { opacity: 0; }
.deal-in { animation: dealIn .26s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes dealIn {
  from { opacity: 0; transform: translateY(-34px) scale(.55); }
  to { opacity: 1; transform: none; }
}
/* 이모지 파티클 (박수·눈물·컨페티) — 화면 전체, 카드 위에 표시 */
.mg-emoji { position: absolute; bottom: 30%; z-index: 38; pointer-events: none; animation: emojiUp 1.9s ease-out forwards; }
@keyframes emojiUp {
  0% { opacity: 0; transform: translateY(44px) scale(.6) rotate(-10deg); }
  16% { opacity: 1; transform: translateY(0) scale(1.15) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-230px) scale(1) rotate(16deg); }
}
.mg-emoji.rain { bottom: auto; top: -60px; animation: emojiRain 2.1s ease-in forwards; }
@keyframes emojiRain {
  0% { opacity: 0; transform: translateY(0) rotate(-6deg); }
  15% { opacity: 1; }
  100% { opacity: .9; transform: translateY(85vh) rotate(10deg); }
}
/* AI 상대 말풍선 */
.mg-quip {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%); z-index: 6;
  background: #fff; color: #222; font-size: 13px; font-weight: 700;
  border-radius: 14px 14px 14px 3px; padding: 8px 13px; max-width: 82%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3); pointer-events: none;
  animation: quipIn .25s ease-out, ptsUp 0s;
}
@keyframes quipIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* 상단 전적 (n승 n패 · ±점) */
.mg-rec { font-style: normal; font-size: 12px; font-weight: 700; color: var(--sub); margin-left: 6px; }
.mg-rec .plus { color: #2f9fe0; }
.mg-rec .minus { color: #d13b2f; }

/* 폭탄: 화면 흔들림 + 폭발 */
.boardshake { animation: boardShake .55s; }
@keyframes boardShake {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-7px, 3px); }
  30% { transform: translate(6px, -4px); }
  45% { transform: translate(-5px, -3px); }
  60% { transform: translate(5px, 3px); }
  80% { transform: translate(-3px, 1px); }
}
.mg-boom {
  position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%);
  font-size: 78px; z-index: 6; pointer-events: none; animation: boomFx .85s ease-out forwards;
}
@keyframes boomFx {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
}
.mg-pop span { width: 76px; }
.mg-pop.fan span { width: 62px; }
.mg-pop.fan span:nth-child(1) { transform: rotate(-8deg) translateY(4px); }
.mg-pop.fan span:nth-child(3) { transform: rotate(7deg) translateY(3px); }
.mg-pop.fan span:nth-child(4) { transform: rotate(14deg) translateY(8px); }
@keyframes popFx {
  0% { opacity: 0; transform: translate(-50%, -56%) scale(.5); }
  16% { opacity: 1; transform: translate(-50%, -56%) scale(1.15); }
  72% { opacity: 1; transform: translate(-50%, -56%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.9); }
}
/* 낸 사람 방향에서 날아오는 느낌 */
.mg-pop.from-me { animation-name: popFromMe; }
@keyframes popFromMe {
  0% { opacity: 0; transform: translate(-50%, 90%) scale(.55); }
  22% { opacity: 1; transform: translate(-50%, -52%) scale(1.15); }
  72% { opacity: 1; transform: translate(-50%, -56%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.9); }
}
.mg-pop.from-opp { animation-name: popFromOpp; }
@keyframes popFromOpp {
  0% { opacity: 0; transform: translate(-50%, -200%) scale(.55); }
  22% { opacity: 1; transform: translate(-50%, -58%) scale(1.15); }
  72% { opacity: 1; transform: translate(-50%, -56%) scale(1.05); }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(.9); }
}
/* 점수 획득 플로팅 */
.mg-ptsfloat {
  font-style: normal; color: #ffe14d; font-weight: 900; font-size: 15px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5); animation: ptsUp 1.2s ease-out forwards;
}
@keyframes ptsUp {
  0% { opacity: 0; transform: translateY(6px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}

.mg-status {
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 7px 11px; text-align: center;
}
/* 내 손패 — 한 줄 겹침 */
.mg-hand { display: flex; justify-content: center; padding: 10px 4px 6px; }
.mg-hand .hw { width: 47px; margin-left: -9px; }
.mg-hand .hw:first-child { margin-left: 0; }

/* 고/스톱 · 결과 모달 */
.mg-stopscore { font-size: 30px; font-weight: 900; color: #2f9fe0; text-align: center; margin: 6px 0; }
.mg-resbox { position: relative; overflow: visible !important; }
.mg-stamp {
  position: absolute; top: -16px; right: 4px; transform: rotate(13deg);
  border: 3px solid; border-radius: 9px; background: var(--card);
  font-size: 23px; font-weight: 900; letter-spacing: 4px; padding: 4px 12px 4px 16px;
  animation: stampIn .35s cubic-bezier(.2, 2, .4, 1); opacity: .93;
}
.mg-stamp.win { color: #2f7dd1; border-color: #2f7dd1; }
.mg-stamp.lose { color: #d13b2f; border-color: #d13b2f; }
.mg-stamp.draw { color: #8a8a8a; border-color: #8a8a8a; }
@keyframes stampIn {
  from { transform: rotate(13deg) scale(2.1); opacity: 0; }
  to { transform: rotate(13deg) scale(1); opacity: .93; }
}
/* 맞고 모달의 큰 글씨 — 기본 검정 상속이라 눈에 안 띄었다. 화투판 감성의 주황·금색으로 */
#matgoView .m-title { color: #e8590c; }
.mg-final { font-size: 26px; font-weight: 900; margin-top: 10px; color: #e8590c; }
.mg-final small { font-size: 13px; font-weight: 700; color: var(--sub); }
.mg-factors { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.mg-factors span {
  background: rgba(232, 89, 12, .13); color: #e8590c;
  font-size: 11.5px; font-weight: 800; border-radius: 999px; padding: 3px 9px;
}
.mg-result { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mg-res-row {
  display: grid; grid-template-columns: auto auto; justify-content: space-between;
  gap: 2px 10px; background: var(--bg); border-radius: 10px; padding: 9px 12px;
}
.mg-res-row b { font-size: 14px; }
.mg-res-row span { font-size: 14px; font-weight: 800; color: #e8590c; }
.mg-res-row small { grid-column: 1 / -1; color: var(--sub); font-size: 11.5px; }
#matgoView .modal { position: absolute; }
.g-mg-join {
  display: block; width: 100%; margin-top: 10px; padding: 11px;
  background: var(--accent-grad); color: var(--accent-text); border-radius: 10px;
  font-weight: 700; font-size: 13.5px;
}

/* 친구 수락 대기 배너 */
.pending-banner {
  margin: 10px 8px; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px;
  font-size: 13px; color: var(--sub); text-align: center; line-height: 1.55;
}
button:disabled { opacity: .45; cursor: default; }

/* 사진 말풍선 */
.bubble.photo { padding: 4px 4px 2px; }
.bubble .bimg { max-width: 200px; max-height: 260px; border-radius: 13px; display: block; }
.bubble.photo time { padding: 2px 6px 4px; }

/* 읽음 확인: 카톡식 '1' — 상대가 읽으면 사라짐 */
.bubble time .rr { font-style: normal; font-weight: 800; margin-right: 5px; color: #e8590c; }
.bubble.me { cursor: pointer; }

/* ---------- 가입 로고 ---------- */
.logo { width: 72px; height: 72px; margin: 0 auto 10px; display: block; }

/* ---------- 그리드 피드 (컴팩트: 사진+닉네임, 한 화면 15명) ---------- */
.grid-feed {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px 12px 12px;
}
.gcard {
  border-radius: 12px; overflow: hidden; position: relative; padding: 0;
  background: var(--card); border: 1px solid var(--line);
}
.gcard .gphoto {
  aspect-ratio: 1.1; background: var(--line); display: flex;
  align-items: center; justify-content: center; font-size: 38px; overflow: hidden;
}
.gcard .gphoto img { width: 100%; height: 100%; object-fit: cover; }
.gcard .gname {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 5px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .72));
  color: #fff; text-align: left; display: flex; flex-direction: column;
}
.gcard .gname b { font-size: 13px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard .gname span { font-size: 10.5px; opacity: .85;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fsearch { flex: 0 0 110px; padding: 7px 9px; font-size: 13px; border-radius: 9px; }
.gcard .gcheck { position: absolute; top: 5px; right: 5px; font-size: 17px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5)); }
.gcard.selected { outline: 3px solid var(--accent); outline-offset: -3px; }

/* ---------- 멀티쪽지 이용권 배너 ---------- */
.promo {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 12px 10px; padding: 9px 12px; width: calc(100% - 24px);
  border-radius: 12px; text-align: left;
  background: linear-gradient(100deg, #4f7cff, #8e6cff); color: #fff;
}
.promo .p-text { display: flex; flex-direction: column; gap: 1px; }
.promo .p-text b { font-size: 14px; }
.promo .p-text small { opacity: .88; font-size: 11px; }
.promo em {
  font-style: normal; font-weight: 800; background: #fff; color: #4f7cff;
  border-radius: 999px; padding: 6px 12px; flex-shrink: 0; font-size: 13px;
}
.promo.active {
  background: var(--card); color: var(--sub); border: 1px solid var(--line);
  font-size: 13px; justify-content: center;
}
.set-item.highlight {
  margin: 12px 16px; width: calc(100% - 32px); border: 1px solid #e6cf00;
  border-radius: 14px; background: rgba(254, 229, 0, .1);
}

/* ---------- 단체쪽지 ---------- */
.filters .chip { flex-shrink: 0; align-self: center; }
.bulk-hint { padding: 6px 16px 10px; font-size: 12px; color: var(--sub); font-weight: 700; }
.person.selected { background: rgba(79, 124, 255, .1); }
.checkmark { flex-shrink: 0; font-size: 18px; }
.bulkbar {
  position: fixed; left: 0; right: 0; bottom: 110px; max-width: var(--shell, 480px); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 10px 14px; margin-left: 12px; margin-right: 12px; z-index: 5;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
@media (min-width: 480px) { .bulkbar { left: 50%; right: auto; transform: translateX(-50%); width: 440px; } }
.compose-sheet { display: flex; flex-direction: column; gap: 10px; }
.compose-sheet .sheet-title { font-weight: 700; padding: 4px 2px 0; }
.compose-sheet .pass-state { font-size: 12px; color: var(--sub); padding: 0 2px; }
.compose-sheet textarea { resize: none; }
.compose-sheet .rowbtns button { border-bottom: 0; width: auto; padding: 10px 14px; }
.composer .copy-btn { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; }
/* 신고·차단 — 작지만 선명하게, 둘은 붙여서 한 묶음으로 보이게 */
.menu-btn { font-size: 16px; color: var(--sub); padding: 4px 5px; }
.menu-btn + .menu-btn { margin-left: -6px; }   /* ov-head 의 gap 10px 를 상쇄 */
.play-btn {
  font-size: 13.5px; font-weight: 700; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; flex-shrink: 0;
}

/* 사진 업로드 선택 시트 */
.sheet {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50;
  display: flex; align-items: flex-end; max-width: var(--shell, 480px); margin: 0 auto;
}
.sheet .sheet-body {
  background: var(--card); width: 100%; border-radius: 16px 16px 0 0; padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.sheet button {
  display: block; width: 100%; padding: 14px; font-size: 15px; text-align: center;
  border-bottom: 1px solid var(--line);
}
.sheet button:last-child { border-bottom: 0; color: var(--sub); }
.sheet .sheet-caption { padding: 10px 12px 4px; font-size: 12px; color: var(--sub); text-align: center; }
.sheet .sheet-link {
  display: block; padding: 14px; font-size: 15px; text-align: center;
  color: var(--link); text-decoration: none; border-bottom: 1px solid var(--line);
}
.bubble a { color: inherit; text-decoration: underline; word-break: break-all; }

/* ---------- 인앱 모달 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; width: min(100%, 340px); max-height: 80vh; overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.m-title { font-weight: 700; font-size: 16px; }
.m-body { font-size: 13px; color: var(--sub); margin-top: 8px; white-space: pre-line; line-height: 1.5; }
.m-input { margin-top: 12px; }
.m-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.m-choice {
  text-align: left; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; background: var(--bg);
}
.m-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.m-btns button { padding: 9px 16px; border-radius: 10px; font-size: 14px; }
.m-cancel { color: var(--sub); border: 1px solid var(--line); }
.m-ok { background: var(--accent-grad); color: var(--accent-text); font-weight: 700; }

/* 알림 문구는 화면 중간에 — 하단은 손가락·키보드에 가려 놓치기 쉽다 (대표 지시) */
#toast {
  position: fixed; top: 42%; left: 50%; transform: translate(-50%, -50%);
  background: #2a2f3a; color: #fff; padding: 14px 20px; border-radius: 16px;
  font-size: 14px; line-height: 1.5; z-index: 99; max-width: 86%; text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.45);
}

/* ===== AI 상담친구 '마음이' ===== */
.ai-row { background: linear-gradient(90deg, rgba(122,92,255,.12), transparent 70%); }
.ai-avatar {
  background: linear-gradient(135deg, #7a5cff, #b44cff);
  font-size: 26px; color: #fff;
}
.ai-badge {
  font-style: normal; font-size: 10px; font-weight: 800; vertical-align: 2px;
  background: linear-gradient(135deg, #7a5cff, #b44cff); color: #fff;
  border-radius: 8px; padding: 2px 6px; margin-left: 3px;
}
.ai-banner { line-height: 1.55; }
.bubble.ai { border-left: 3px solid #9a6cff; }
.bubble.typing { padding: 13px 16px; }
.bubble .dots i {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .35; margin: 0 2px;
  animation: ai-dot 1.2s infinite;
}
.bubble .dots i:nth-child(2) { animation-delay: .2s; }
.bubble .dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ai-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ===== 카톡형 첫 화면 (조용한 리스트) ===== */
.myprofile {
  display: flex; gap: 12px; padding: 16px; align-items: center;
  width: 100%; text-align: left; border-bottom: 6px solid var(--line);
}
.myprofile .avatar { width: 58px; height: 58px; border-radius: 20px; }
.myprofile .intro { font-size: 13px; color: var(--sub); margin-top: 3px; }
.ppl-tools { display: flex; gap: 6px; padding: 10px 12px 4px; }
.newbies { display: flex; gap: 13px; overflow-x: auto; padding: 8px 16px 12px; border-bottom: 1px solid var(--line); }
.newbie { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 0 0 54px; padding: 0; }
.newbie .avatar { width: 50px; height: 50px; border-radius: 17px; }
.newbie span {
  font-size: 11px; color: var(--text); max-width: 56px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.person .ago { text-align: right; line-height: 1.5; }

/* [v4] 집게 뽑기·도감 그리드 */
.claw-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-height: 46vh; overflow-y: auto; margin: 10px 0; padding: 2px;
}
.claw-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 8px 4px; text-align: center; cursor: pointer;
}
.claw-item img { width: 100%; height: 54px; object-fit: contain; }
.claw-item span { display: block; font-size: 11.5px; margin-top: 4px; color: var(--text); }
.claw-item.locked { opacity: .45; filter: grayscale(1); cursor: default; }

/* 탈 선택의 성별 구분 라벨 */
.mask-sec {
  grid-column: 1 / -1; width: 100%; text-align: left;
  font-size: 12.5px; font-weight: 700; color: var(--sub); margin: 8px 2px 2px;
}

/* 사진 0장 안내 — 올리면 뭐가 좋아지는지(알림 자동 발송·공개)를 먼저 보여준다 */
.photo-nudge {
  display: block; width: calc(100% - 24px); margin: 10px 12px 2px; padding: 13px 15px;
  text-align: left; border: 1px solid var(--accent); border-radius: 13px;
  background: rgba(79, 124, 255, .08); color: var(--text); cursor: pointer;
}
.photo-nudge b { color: var(--accent); }
.photo-nudge span { display: block; font-size: 13px; line-height: 1.55; margin-top: 4px; }
.photo-nudge em { display: block; font-style: normal; font-size: 13px; font-weight: 700;
  color: var(--accent); margin-top: 7px; }
.photo-nudge-sub {
  margin: 8px 16px 2px; padding: 11px 13px; font-size: 13px; line-height: 1.55;
  border: 1px solid var(--accent); border-radius: 11px;
  background: rgba(79, 124, 255, .08); color: var(--text);
}
.photo-nudge-sub b { color: var(--accent); }

/* 대화명 중복 확인 표시 */
.nick-check { font-size: 12px; min-height: 15px; margin: -4px 0 0 4px; }
.nick-check.ok { color: #2f9d5c; }
.nick-check.no { color: var(--danger); }

/* 사진 선택 시트: 배경을 어둡게 하지 않는다 */
.sheet.clear { background: transparent; }
.sheet.clear .sheet-body {
  border: 1px solid var(--line);
  box-shadow: 0 -10px 34px rgba(0, 0, 0, .28);
}

/* 대표 사진 배지·설정 버튼 */
.ph .main-badge {
  position: absolute; left: 4px; top: 4px; background: var(--accent-grad);
  color: var(--accent-text); font-size: 10px; font-weight: 800;
  border-radius: 6px; padding: 2px 6px;
}
/* '대표로' 는 왼쪽 맨 위. 아래쪽에 두었더니 좁은 칸에서 📷 와 글자가 겹쳐 읽히지 않았다.
   대표 배지와 같은 자리지만 둘은 같이 나오지 않는다 (대표면 배지, 아니면 이 버튼). */
.ph .mkmain {
  position: absolute; left: 4px; top: 4px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 3px 7px;
}

/* 프로필 저장 바 */
.unsaved-note { text-align: center; font-size: 11.5px; color: #e8590c; font-weight: 700; padding-bottom: 6px; }
.savebar { display: flex; gap: 8px; justify-content: center; padding: 0 16px 16px; }
.savebar .chip { padding: 9px 22px; font-size: 14px; }

/* 중앙 소형 선택 카드 (사진 찍기/앨범) — 화면을 덮거나 어둡게 하지 않는다 */
.choice-pop {
  position: fixed; inset: 0; z-index: 60; background: transparent;
  display: flex; align-items: center; justify-content: center;
  max-width: var(--shell, 480px); margin: 0 auto;
}
.choice-pop .pop-body {
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  width: min(72%, 250px); overflow: hidden;
  box-shadow: 0 12px 38px rgba(0, 0, 0, .25);
  animation: popIn .16s ease-out;
}
@keyframes popIn { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.choice-pop button {
  display: block; width: 100%; padding: 13px; font-size: 14.5px; font-weight: 600;
  text-align: center; border-bottom: 1px solid var(--line);
}
.choice-pop button small { color: var(--sub); font-weight: 400; font-size: 11.5px; }
.choice-pop button:last-child { border-bottom: 0; color: var(--sub); font-weight: 400; }

/* 사진 전체화면 보기 */
.photo-viewer {
  position: fixed; inset: 0; z-index: 120; background: rgba(0, 0, 0, .93);
  display: flex; align-items: center; justify-content: center; cursor: zoom-out;
}
.photo-viewer img { max-width: 96%; max-height: 92%; object-fit: contain; border-radius: 8px; }
.section-title .phdone { padding: 3px 12px; font-size: 12px; margin-left: 6px; }
.ph { -webkit-touch-callout: none; user-select: none; }

/* 상대 프로필: 스크롤 영역 + 하단 입력창 */
.pv-scroll { flex: 1; overflow-y: auto; }
.composer .ic-danger { padding: 0 10px; font-size: 15px; }

/* 카톡식 상대 메시지 행 (썸네일 + 이름 + 말풍선) */
.msg-row { display: flex; gap: 8px; align-items: flex-start; }
.msg-row .msg-avatar { width: 36px; height: 36px; border-radius: 13px; font-size: 17px; }
.msg-row.cont { padding-left: 44px; }
.msg-col { display: flex; flex-direction: column; gap: 3px; max-width: 78%; min-width: 0; }
.msg-name { font-size: 11.5px; color: var(--sub); margin-left: 2px; }
.msg-col .bubble { max-width: 100%; align-self: flex-start; }

/* 쪽지 카드 팝업 */
.note-box { width: min(100%, 320px); }
.note-head { display: flex; gap: 11px; align-items: center; }
.note-avatar { width: 54px; height: 54px; border-radius: 17px; }
.note-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.note-info b { font-size: 16px; }
.note-info small { color: var(--sub); font-size: 12px; }
.note-info .note-intro { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-box textarea { margin-top: 12px; resize: none; background: var(--bg); }
.note-opt {
  display: flex; align-items: center; gap: 7px; margin-top: 10px;
  font-size: 13.5px; font-weight: 600; cursor: pointer; user-select: none;
}
.note-opt input { width: 17px; height: 17px; accent-color: var(--accent); }
.note-hint { display: block; margin-top: 6px; font-size: 11.5px; color: var(--sub); line-height: 1.5; }

/* 차단 목록 모달 — 썸네일 있는 행으로 누군지 확인하며 해제 */
.block-box { width: min(100%, 340px); }
.block-list { max-height: 55vh; overflow-y: auto; margin-top: 8px; }
.block-list .person { padding: 9px 2px; }
.block-list .person:last-child { border-bottom: none; }
.block-list .chip { flex-shrink: 0; }

/* 쪽지 확인 카드 — 최근 쪽지를 짧게 보여주는 미니 스레드 */
.note-thread { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.nt-msg {
  max-width: 85%; padding: 8px 11px; border-radius: 13px;
  font-size: 13.5px; line-height: 1.5; word-break: break-word; white-space: pre-wrap;
}
.nt-msg.you { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.nt-msg.me { align-self: flex-end; background: var(--bubble-me); color: var(--bubble-me-text); }
.note-box .note-tag { margin-top: 10px; font-size: 12px; }
.note-wait { margin-top: 10px; font-size: 12px; color: var(--sub); text-align: center; }
#noteReply { margin-top: 10px; resize: none; background: var(--bg); }

/* 쪽지 탭 (일회성 쪽지 목록) */
.notebox-empty { padding: 14px 16px; font-size: 12.5px; color: var(--sub); border-bottom: 1px solid var(--line); }
.note-tag { margin-top: 3px; font-size: 11.5px; color: var(--sub); }
.note-tag.in { color: var(--link); font-weight: 700; }
.section-title .phdone { float: right; margin-top: -3px; }

/* ---------- 가면 위치 손조정 (사진첩) ---------- */
.ph .fixmask {
  position: absolute; right: 4px; top: 4px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 6px; line-height: 1.3;
}
/* [v5] 가면 바꾸기 버튼 — 🎯 아래 줄 */
.ph .swapmask {
  position: absolute; right: 4px; bottom: 4px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 6px; line-height: 1.3;
}
/* 사진 갈아 끼우기 — 사진첩이 꽉 차도 한 장씩 바꿀 수 있게 하는 길이다.
   '대표로' 가 위로 올라가면서 왼쪽 아래가 비었다. 네 귀퉁이에 하나씩 놓아
   좁은 칸(110px)에서도 서로 겹치지 않게 한다. */
.ph .replph {
  position: absolute; left: 4px; bottom: 4px; background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 12px; border-radius: 6px; padding: 2px 6px; line-height: 1.3;
}
/* [v5] 가면 바꾸기 미리보기 무대 */
.swap-stage { display: flex; justify-content: center; position: relative; }
.swap-stage img {
  max-width: 100%; max-height: 34vh; border-radius: 12px; border: 1px solid var(--line);
}
.mask-grid .mg-item.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* 집게 뽑기 화면 CSS 는 claw.css 로 분리됨 (전달본 이식) */

.hint-line { font-size: 11.5px; color: var(--sub); padding: 6px 16px 0; }

/* 가면 고르기 그리드 (사진 올릴 때) */
.mask-pop .sub { font-size: 12px; color: var(--sub); }
.mask-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  max-height: 46vh; overflow-y: auto;
}
.mask-grid .mg-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); width: auto;
}
.mask-grid .mg-item img { width: 100%; height: 42px; object-fit: contain; }
.mask-grid .mg-item span { font-size: 11px; color: var(--sub); font-weight: 600; }

/* 위치 조정 화면 */
.adjust-pop .pop-body.adjust-body {
  width: min(94%, 400px); padding: 16px; display: flex; flex-direction: column; gap: 10px;
  text-align: left;
}
.adjust-body > b { font-size: 16px; }
.adjust-body .sub { font-size: 12.5px; color: var(--sub); }
.adjust-stage {
  position: relative; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; display: flex; justify-content: center;
}
/* 컨트롤이 늘어난 만큼 미리보기 높이를 줄여 작은 화면에서도 저장 버튼까지 보이게 한다 */
.adjust-stage img {
  max-width: 100%; max-height: 38vh; display: block;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-drag: none;
}
.adjust-stage img:active { cursor: grabbing; }
.adj-spin {
  position: absolute; inset: 0; background: rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center;
}
.adj-spin::after {
  content: ""; width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  animation: adjspin .7s linear infinite;
}
@keyframes adjspin { to { transform: rotate(360deg); } }
/* 미세 이동 십자패드 — 손가락 드래그로는 1~2px을 맞추기 어렵다 */
.adj-pad {
  display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 30px);
  justify-content: center; gap: 3px; margin: 2px 0 4px;
}
/* .choice-pop button:last-child 가 마지막 버튼을 흐리게 만들므로(취소 버튼용 규칙)
   십자패드·± 버튼은 그 영향을 받지 않도록 색을 명시한다. */
.adj-pad .nudge,
.adjust-pop .adj-pad .nudge:last-child {
  width: auto; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--text); font-size: 14px; line-height: 1; font-weight: 600;
  display: flex; align-items: center; justify-content: center; touch-action: none;
}
.adj-pad .nudge:active { background: var(--accent-grad); color: #fff; border-color: transparent; }
/* 화살표는 글자 대신 CSS 삼각형 — 방향별로 다른 글꼴이 잡혀 굵기가 달라 보이는 문제를 피한다.
   currentColor 를 쓰므로 :active 일 때 함께 흰색이 된다. */
.adj-pad .nudge i {
  display: block; width: 0; height: 0;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-bottom: 7px solid currentColor;
}
.adj-pad .up { grid-area: 1 / 2; }
.adj-pad .left { grid-area: 2 / 1; }
.adj-pad .left i { transform: rotate(-90deg); }
.adj-pad .center { grid-area: 2 / 2; color: var(--sub); }
.adj-pad .right { grid-area: 2 / 3; }
.adj-pad .right i { transform: rotate(90deg); }
.adj-pad .down { grid-area: 3 / 2; }
.adj-pad .down i { transform: rotate(180deg); }

.adj-row { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); }
.adj-row > span { width: 30px; flex: 0 0 auto; }
.adj-row .step,
.adjust-pop .adj-row .step:last-child {
  width: 28px; height: 26px; flex: 0 0 auto; padding: 0; border: 1px solid var(--line);
  border-radius: 7px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; touch-action: none;
}
.adj-row .step:active { background: var(--accent-grad); color: #fff; border-color: transparent; }
.adj-row em {
  flex: 0 0 auto; width: 42px; text-align: right; font-style: normal;
  font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); font-weight: 600;
}
.adj-row input[type="range"] {
  flex: 1; min-width: 0; accent-color: var(--link); padding: 0; border: 0; background: none;
}
.adj-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; padding-top: 2px; }
.adjust-pop .adj-actions .chip {
  display: inline-block; width: auto; padding: 9px 13px; border-bottom: 0;
  font-size: 13px; color: var(--text); font-weight: 600; white-space: nowrap;
}
.adjust-pop .adj-actions .chip.primary {
  background: var(--accent-grad); border-color: transparent; color: #fff; font-weight: 700;
}

/* 상점 — 매출이 나오는 곳이라 상단에서 제일 눈에 띄어야 한다.
   아이콘만 두면 다른 버튼에 묻히므로, 보유 포인트를 함께 띄운 알약 버튼으로 만든다.
   숫자가 보이면 "여기가 내 지갑"이라는 게 설명 없이 전달된다. */
/* 상점 버튼 — 가면 아이콘이 주인공이므로 알약은 뒤로 물러난다.
   포인트 색(주황) 위에 브랜드 하늘색 아이콘을 얹으면 서로 싸워서, 알약은 카드색으로 두고
   숫자만 포인트 색을 갖는다. 눈구멍이 뚫려 있어 알약 배경이 그대로 비친다. */
#topbar .shop-pill {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px 4px 6px;
  font-size: 13px; font-weight: 800; line-height: 1;
  box-shadow: 0 1px 5px rgba(47, 127, 224, .18);
}
#topbar .shop-pill .sp-ico { width: 26px; height: 18px; display: block; }
#topbar .shop-pill .sp-badge-bg { fill: var(--shop-badge-bg); }
#topbar .shop-pill .sp-badge-fg { stroke: var(--shop-badge-fg); fill: none; }
#topbar .shop-pill em { font-style: normal; font-variant-numeric: tabular-nums; color: #d9832b; }
:root[data-theme="dark"] #topbar .shop-pill em { color: #f0a850; }
#topbar .shop-pill:active { transform: scale(.95); }

/* ---------- 가면무도회 ---------- */
.ball-banner {
  display: flex; align-items: center; gap: 10px; width: 100%;
  margin: 10px 16px 0; width: calc(100% - 32px);
  padding: 12px 14px; border-radius: 14px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
}
.ball-banner.open {
  background: linear-gradient(135deg, #2b1b4d, #14243f); border-color: #3d2f66; color: #fff;
}
.ball-banner .bb-icon { font-size: 24px; flex-shrink: 0; }
.ball-banner .bb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ball-banner .bb-text b { font-size: 14.5px; }
.ball-banner .bb-text small { font-size: 11.5px; opacity: .75; }
.ball-banner.open .bb-text small { color: #cfd6e0; }
.ball-banner em { font-style: normal; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.ball-banner .chip { flex-shrink: 0; }

.ball-view {
  position: fixed; inset: 0; z-index: 110; max-width: var(--shell, 480px); margin: 0 auto;
  background: linear-gradient(180deg, #1a1230, #0d1626);
  color: #eef2f7; display: flex; flex-direction: column;
}
.bl-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid rgba(255, 255, 255, .12); flex-shrink: 0;
}
.bl-top > b { font-size: 16px; }
.bl-out { color: #cfd6e0; font-size: 13px; }
.bl-body {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; text-align: center;
}
.bl-body > b { font-size: 17px; }
.bl-body .int-label { color: #cfd6e0; }
.bl-spin { font-size: 54px; animation: blFloat 2.4s ease-in-out infinite; }
@keyframes blFloat { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.bl-queue {
  background: rgba(255, 255, 255, .08); border-radius: 12px; padding: 10px 14px;
  font-size: 13.5px; display: flex; flex-direction: column; gap: 3px;
}
.bl-queue small { color: #b8c2d0; font-size: 11.5px; }
.bl-note {
  margin-top: 14px; font-size: 12.5px; line-height: 1.7; color: #b8c2d0;
  background: rgba(255, 255, 255, .06); border-radius: 12px; padding: 12px 14px;
}
/* 무도회 화면은 항상 어두운 배경이라 .chip 의 기본색(밝은 카드)을 그대로 쓰면
   흰 버튼에 흰 글자가 된다. 여기서는 색을 직접 지정한다. */
.bl-matched .chip {
  width: min(100%, 260px); padding: 12px;
  background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .22);
  color: #eef2f7; font-weight: 600;
}
.bl-matched .chip.primary { background: var(--accent-grad); border-color: transparent; color: #fff; font-weight: 700; }

.br-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.br-who .br-face { width: 38px; height: 38px; border-radius: 13px; flex-shrink: 0; }
.br-who b { font-size: 15px; }
.br-who small { color: #b8c2d0; font-size: 11.5px; }
.br-left {
  font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; flex-shrink: 0;
}
.br-left.hot { color: #ff8a80; animation: rcPulse .9s ease-out infinite; }
.br-cards { padding: 10px 16px 0; flex-shrink: 0; }
.br-cards .int-label { color: #b8c2d0; }
.br-deck { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; }
.br-deck .br-card {
  flex: 0 0 auto; max-width: 70%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; color: #eef2f7;
}
.br-log {
  flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px;
}
.br-msg {
  max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5;
  word-break: break-word; white-space: pre-wrap;
}
.br-msg.me { align-self: flex-end; background: var(--accent-grad); color: #fff; }
.br-msg.you { align-self: flex-start; background: rgba(255, 255, 255, .12); }
.br-pick { padding: 0 16px; flex-shrink: 0; }
.br-pickbtn {
  width: 100%; padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, #ff6b9d, #d64f7f); color: #fff;
  animation: blPop .3s ease-out;
}
@keyframes blPop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.br-picked {
  text-align: center; font-size: 13px; color: #ffc4d6; padding: 12px;
  background: rgba(255, 107, 157, .14); border-radius: 12px;
}
.br-say {
  display: flex; gap: 8px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, .12); flex-shrink: 0;
}
.br-say input {
  flex: 1; min-width: 0; background: rgba(255, 255, 255, .1); color: #eef2f7;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 999px; padding: 10px 14px; font-size: 14px;
}
.br-say button {
  background: var(--accent-grad); color: #fff; border-radius: 999px;
  padding: 10px 16px; font-size: 14px; font-weight: 700; flex-shrink: 0;
}

/* 남성 성실 등급 배지 — 여성에게 "꾸준히 활동해 온 사람"을 알리는 신호 */
.grade-badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; font-style: normal;
  padding: 2px 8px; border-radius: 999px; vertical-align: middle; margin-left: 6px;
  background: var(--bg); border: 1px solid var(--line); color: var(--sub);
}
.grade-badge.silver { color: #6b7280; border-color: #9ca3af; }
.grade-badge.gold { color: #a16207; border-color: #d4a017; }
.grade-badge.diamond { color: #0e7490; border-color: #22b8cf; }
.shop-body .sku-price { display: block; font-style: normal; font-weight: 700; margin-top: 2px; }
.shop-body .sku-unit { display: block; font-style: normal; font-size: 11px; color: var(--sub); font-weight: 400; }

/* ---------- 제재 · 이의신청 ---------- */
.sanction-view {
  position: fixed; inset: 0; z-index: 130; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  max-width: var(--shell, 480px); margin: 0 auto;
}
.sv-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 22px 20px; width: 100%; display: flex; flex-direction: column; gap: 10px;
  text-align: center;
}
.sv-icon { font-size: 40px; }
.sv-box > b { font-size: 17px; }
.sv-msg { font-size: 14px; color: var(--text); margin: 0; }
.sv-reason { font-size: 12.5px; color: var(--sub); margin: 0; }
.sv-appeal {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; display: flex; flex-direction: column; gap: 8px; text-align: left;
}
.sv-appeal.done { text-align: center; font-size: 13.5px; font-weight: 600; color: var(--pass, var(--text)); }
.sv-appeal textarea {
  width: 100%; resize: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px; font-size: 13.5px; color: var(--text);
}
.sv-box .chip { width: 100%; }

/* ---------- 상점 · 룰렛 (v1.3) ---------- */
.shop-pop .pop-body.shop-body {
  width: min(92%, 400px); max-height: 85vh; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 10px; text-align: left;
}
.shop-body > b { font-size: 16px; }
.wallet-row { display: flex; gap: 6px; }
.wal-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px;
  font-size: 15px;
}
.wal-item b { font-size: 14px; }
.wal-item span { font-size: 10.5px; color: var(--sub); }
.level-box {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.lv-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.lv-head .lv-pts { font-size: 12px; color: var(--sub); font-weight: 600; }
.lv-bar { height: 7px; border-radius: 4px; background: var(--line); overflow: hidden; }
.lv-fill { height: 100%; background: var(--accent-grad); border-radius: 4px; }
.lv-missions { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.ms-row { font-size: 12.5px; color: var(--sub); }
.ms-row.done { color: var(--text); font-weight: 600; }
.ms-note { font-size: 11px; color: var(--sub); margin-top: 2px; }
.shop-body .section-title { padding: 2px 0 0; font-size: 13px; }
.shop-body .chip { width: 100%; }
.shop-body .chip.shop-buy { text-align: left; font-weight: 600; }
.roul-pool {
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.rp-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.rp-head span { font-size: 11.5px; color: var(--sub); font-weight: 600; }
.rp-masks {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  max-height: 30vh; overflow-y: auto;
}
.rp-mask {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px; border-radius: 8px; opacity: .45;
}
.rp-mask.owned { opacity: 1; background: var(--card); border: 1px solid var(--line); }
.rp-mask img { width: 100%; height: 26px; object-fit: contain; }
.rp-mask span { font-size: 9.5px; color: var(--sub); text-align: center; }
.rp-buy-row { display: flex; gap: 6px; flex-wrap: wrap; }
/* .choice-pop button:last-child 가 각 풀 카드의 마지막(=제일 중요한) 버튼을 흐리게 만들므로 되돌린다.
   남성 풀은 버튼이 카드에 하나뿐이라 그 버튼 자체가 :last-child 다 — 같이 잡아야 한다. */
.roul-pool .chip, .roul-pool .chip:last-child { color: var(--text); font-weight: 600; }
.roul-pool .chip.accent, .roul-pool .chip.accent:last-child { color: var(--accent-text); font-weight: 700; }
.rp-buy-row .chip { width: auto; flex: 1; }
.rp-full { font-size: 12px; color: var(--sub); padding: 8px 0; text-align: center; flex: 1; }

/* ---------- 가면 벗기 (v1.3) ---------- */
.reveal-pop .rv-warn { color: #b8531f; }

/* 3 → 2 → 1 카운트다운 */
.reveal-count {
  position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 14, .93);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  max-width: var(--shell, 480px); margin: 0 auto;
}
.reveal-count .rc-num {
  font-size: 84px; font-weight: 800; color: #fff; line-height: 1;
  font-variant-numeric: tabular-nums; animation: rcPulse .9s ease-out infinite;
}
.reveal-count .rc-sub { color: #cfd6e0; font-size: 14px; }
@keyframes rcPulse { from { transform: scale(1.14); opacity: .65; } to { transform: scale(1); opacity: 1; } }

/* 10초 공개 화면 */
.reveal-view {
  position: fixed; inset: 0; z-index: 92; background: #06070a;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px; max-width: var(--shell, 480px); margin: 0 auto;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.reveal-view .rv-top {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  color: #fff; font-size: 15px;
}
.reveal-view .rv-left {
  font-variant-numeric: tabular-nums; font-weight: 800; font-size: 20px;
  color: #ffd45e; min-width: 34px; text-align: right;
}
.reveal-view .rv-stage {
  position: relative; flex: 1; width: 100%; overflow: hidden; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; background: #0d0f14;
}
.reveal-view .rv-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  pointer-events: none; -webkit-user-drag: none;
}
/* 워터마크 — 캡처를 막을 수는 없으니, 유출되면 누가 봤는지 남게 한다 */
.reveal-view .rv-mark {
  position: absolute; inset: -20%; display: flex; flex-wrap: wrap;
  align-content: center; justify-content: center; gap: 26px 34px;
  transform: rotate(-24deg); pointer-events: none;
}
.reveal-view .rv-mark span {
  color: rgba(255, 255, 255, .28); font-size: 12px; font-weight: 700; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}
/* 앱을 벗어나면 즉시 가린다 */
.reveal-view .rv-hide {
  position: absolute; inset: 0; background: #06070a; color: #9aa3b2;
  display: none; align-items: center; justify-content: center; font-size: 14px;
}
.reveal-view.away .rv-hide { display: flex; }
.reveal-view .rv-note { color: #8d95a3; font-size: 11.5px; text-align: center; }
.reveal-view .rv-close {
  width: auto; padding: 10px 26px; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2); color: #fff; border-radius: 999px;
}

/* 프로필의 "내 가면" — 뽑는 즉시 여기에 쌓인다 (따로 담는 절차 없음) */
.my-masks {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 8px; padding: 4px 16px 10px;
}
.my-mask {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px;
}
.my-mask img { width: 100%; height: 46px; object-fit: contain; }
.my-mask span {
  font-size: 10.5px; font-weight: 600; color: var(--sub);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.my-masks .empty { grid-column: 1 / -1; }

/* 사진첩 안의 캐릭터 칸 — 사진과 같은 문법이되 지우거나 가면을 바꿀 수 없다 */
.photos .char-ph img { object-fit: cover; }

/* 남성 가입 대기 (성비 게이트) — 가입 화면 위에 덮는다 */
.wait-view {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(3px);
}
.wait-card {
  width: min(100%, 360px); background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 22px 22px; text-align: center; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .18);
}
.wait-ic { font-size: 40px; line-height: 1; }
.wait-card h2 { margin: 0; font-size: 19px; }
.wait-sub { margin: 0; color: var(--sub); font-size: 13.5px; line-height: 1.6; }
.wait-num { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 6px 0 0; }
.wait-num b { font-size: 44px; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.wait-num span { font-size: 15px; color: var(--sub); font-weight: 700; }
.wait-meta { font-size: 12.5px; color: var(--sub); }
.wait-card .primary { margin-top: 8px; }

/* 가면 씌우는 중 — 서버가 얼굴을 재는 1초 안팎 동안 무슨 일이 일어나는지 보여 준다 */
.fitting {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15, 18, 24, .55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
}
.fitting.hidden { display: none; }
.fit-card {
  background: var(--card); color: var(--fg);
  border-radius: 18px; padding: 26px 30px; width: min(320px, 82vw);
  text-align: center; box-shadow: 0 18px 44px rgba(0, 0, 0, .28);
}
.fit-card b { display: block; font-size: 17px; margin-bottom: 6px; }
.fit-mask { font-size: 40px; line-height: 1; margin-bottom: 10px; animation: fitpulse 1.4s ease-in-out infinite; }
@keyframes fitpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.fit-step { font-size: 14px; color: var(--muted); min-height: 20px; }
.fit-bar { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin: 14px 0 10px; }
.fit-bar i { display: block; height: 100%; width: 40%; border-radius: 3px; background: var(--accent, #3b82f6); animation: fitslide 1.1s ease-in-out infinite; }
@keyframes fitslide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.fit-note { font-size: 12px; color: var(--muted); }

/* 통 고르기 — 뽑기 전에 어느 세계에서 뽑을지 정한다. 네 통은 대등하다(티켓 값이 같다) */
.machine-pop .mc-list { display: grid; gap: 8px; margin: 12px 0; }
.machine-pop .mc-item {
  text-align: left; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--card); cursor: pointer;
}
.machine-pop .mc-item:active { background: var(--bg); }
.machine-pop .mc-name { font-size: 15.5px; font-weight: 800; }
.machine-pop .mc-tag { font-size: 12.5px; color: var(--sub); margin-top: 2px; }
.machine-pop .mc-count { font-size: 12px; color: var(--sub); margin-top: 6px; }
.machine-pop .mc-coming { color: var(--sub); opacity: .8; }

/* ---------- 가면 도감 ---------- */
.dex-view {
  position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column;
}
.dex-body { flex: 1; overflow-y: auto; padding: 0 0 24px; }
.dex-sum {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 14px; color: var(--sub);
}
.dex-sum b { color: var(--fg); font-size: 16px; }
.dex-legend { display: flex; gap: 10px; font-size: 11.5px; }
.dex-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; }
.dex-legend i.own { background: var(--accent, #3b82f6); }
.dex-legend i.miss { background: var(--line); }
.dex-legend i.soon { background: transparent; border: 1px dashed var(--line); }
.dex-mc { padding: 6px 16px 10px; }
.dex-mc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.dex-mc-head b { font-size: 15.5px; }
.dex-mc-head small { flex: 1; font-size: 12px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dex-mc-head em { font-style: normal; font-size: 12px; color: var(--sub); }
.dex-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dex-cell { min-width: 0; }
.dex-cell {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 4px; min-height: 74px;
}
.dex-cell img { width: 100%; height: 44px; object-fit: contain; }
.dex-cell span {
  font-size: 10.5px; font-weight: 600; color: var(--sub);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 미보유 — 실루엣. 그림은 보내지도 않는다 */
.dex-cell.miss .sil { height: 44px; display: flex; align-items: center; font-size: 26px; filter: grayscale(1); opacity: .35; }
.dex-cell.miss span { opacity: .6; }
/* 준비 중 — 빈 자리. 점선 테두리로 '아직 없음'을 알린다 */
.dex-cell.soon { background: transparent; border-style: dashed; justify-content: center; }
.dex-cell.soon span { color: var(--sub); opacity: .55; font-weight: 500; }
/* 명작 표시 */
.dex-cell.mp::after {
  content: "★"; position: absolute; right: 5px; top: 3px; font-size: 11px; color: #d4a017;
}
.dex-cell.miss.mp::after { opacity: .5; }
.dex-note { padding: 8px 16px 0; font-size: 12px; color: var(--sub); }

/* 설정·가입의 약관/정책 링크 */
.set-links a, .check a { color: var(--link, #3b82f6); text-decoration: underline; }
.set-item.set-legal { cursor: default; }
.legal-strip { text-align: center; font-size: 11px; color: var(--sub); padding: 4px 8px 6px; }
.legal-strip a { color: var(--sub); }
