/* 회원 화면 (허브 시안 B) — 마이페이지(design/b-my.html) · 그룹. layouts/hub 의 base.css · b.css 토큰 위에서만 쓴다. */

/* ---------- 공통 ---------- */
.mb-flash { margin-top: 20px; padding: 12px 16px; border-radius: 12px; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; }
.mb-flash.is-error { background: var(--brand-soft); color: var(--brand-ink); }
.mb-empty { padding: 28px 12px; text-align: center; color: var(--text-3); font-size: 14px; }
.mb-empty .btn { margin-top: 12px; }
.mb-field { display: grid; gap: 6px; margin-bottom: 16px; }
.mb-field > span { font-size: 13.5px; font-weight: 700; }
.mb-field small { font-size: 12.5px; color: var(--text-3); }
.mb-input, .mb-field input[type="text"], .mb-field input[type="email"], .mb-field input[type="password"], .mb-field select, .mb-field textarea {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font: inherit; font-size: 14.5px;
}
.mb-field textarea { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; }
.mb-input:focus, .mb-field input:focus, .mb-field select:focus, .mb-field textarea:focus { outline: none; border-color: var(--brand); }
.mb-radio { display: grid; gap: 8px; }
.mb-radio label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 14px; }
.mb-radio label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.mb-radio input { margin-top: 3px; accent-color: var(--brand); }
.mb-radio b { display: block; }
.mb-radio small { color: var(--text-3); font-size: 12.5px; }
.mb-check { display: flex; gap: 10px; align-items: center; font-size: 14px; padding: 6px 0; cursor: pointer; }
.mb-check input { width: 18px; height: 18px; accent-color: var(--brand); }
.mb-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mb-row .mb-input { flex: 1; min-width: 180px; }
.btn-danger { border: 1px solid var(--line); color: var(--brand-ink); }
.btn-danger:hover { border-color: var(--brand); }
.mb-pager { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.mb-pager a, .mb-pager span { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; font-size: 14px; font-weight: 700; }
.mb-pager a:hover { background: var(--surface-2); }
.mb-pager .on { background: var(--text); color: var(--bg); }
.role-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.role-owner { background: var(--brand-soft); color: var(--brand-ink); }
.role-staff { background: var(--sky-soft); color: var(--sky); }
.role-member { background: var(--surface-2); color: var(--text-2); }
.vis-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.vis-pill svg.lucide { width: 13px; height: 13px; }

/* ---------- 마이페이지 (시안 B b-my) ---------- */
.prof { margin-top: 28px; padding: 28px 32px; border-radius: 24px; border: 1px solid var(--line); background: radial-gradient(120% 160% at 100% 0%, #16306a, #121726 50%, var(--surface)); display: flex; gap: 22px; align-items: center; flex-wrap: wrap; color: #fff; }
:root[data-theme="light"] .prof { background: radial-gradient(120% 160% at 100% 0%, #d6e3ff, #f1f5ff 50%, var(--surface)); color: var(--text); }
.prof .pav.big { width: 84px; height: 84px; font-size: 30px; border: 3px solid var(--brand); overflow: hidden; }
.prof .pav.big img { width: 100%; height: 100%; object-fit: cover; }
.prof h1 { font-size: 26px; letter-spacing: -0.04em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.prof .handle { color: var(--text-3); font-size: 14px; }
.prof .bio { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.prof .stats { margin-left: auto; display: flex; gap: 28px; }
.prof .stats > * { text-align: center; display: block; color: inherit; }
.prof .stats b { display: block; font-size: 22px; letter-spacing: -0.03em; }
.prof .stats span { font-size: 12px; color: var(--text-3); }
.prof .acts { display: flex; gap: 8px; }

.my { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; margin-top: 28px; padding-bottom: 64px; }
.mnav { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.mnav a, .mnav button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; color: var(--text-2); width: 100%; text-align: left; }
.mnav a:hover, .mnav a.on, .mnav button:hover { background: var(--surface-2); color: var(--text); }
.mnav a.on svg.lucide { color: var(--brand); }
.mnav svg.lucide { width: 18px; height: 18px; flex: none; }
.mnav .n { margin-left: auto; font-size: 12px; color: var(--text-3); }
.mnav .n.dot { color: var(--on-brand); background: var(--brand); border-radius: 99px; padding: 0 7px; font-weight: 800; }
.mnav hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

.dash { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; align-content: start; }
.w { padding: 20px; min-width: 0; }
.w h3 { font-size: 16px; letter-spacing: -0.02em; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.w h3 svg.lucide { width: 18px; height: 18px; color: var(--brand); }
.w h3 a { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.w h3 a:hover { color: var(--text); }
.w h2.pg { font-size: 22px; letter-spacing: -0.03em; margin-bottom: 4px; }
.w .pg-sub { color: var(--text-3); font-size: 14px; margin-bottom: 18px; }
.span6 { grid-column: span 6; }
.span4 { grid-column: span 4; }
.span3 { grid-column: span 3; }
.span2 { grid-column: span 2; }

/* 등급 사다리 — 이용 등급(전체 · 회원 · 크리에이터 · PRO) */
.ladder { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; margin: 6px 0 18px; }
.ladder::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 15px; height: 4px; border-radius: 4px; background: var(--surface-2); }
.ladder .fill { position: absolute; left: 12.5%; top: 15px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--green), var(--sky), var(--violet), var(--brand)); }
.ladder div { text-align: center; position: relative; z-index: 1; font-size: 12.5px; color: var(--text-3); }
.ladder i.st { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 6px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--line); }
.ladder i.st svg.lucide { width: 15px; height: 15px; }
.ladder .done.t-free { color: var(--green); }
.ladder .done.t-member { color: var(--sky); }
.ladder .done.t-creator { color: var(--violet); }
.ladder .done.t-pro { color: var(--brand); }
.ladder .done i.st { background: var(--surface); border-color: currentColor; }
.ladder .now i.st { background: var(--violet); color: #fff; border-color: var(--violet); box-shadow: 0 0 0 5px var(--violet-soft); }
.ladder .now { color: var(--text); font-weight: 800; }
.lv-line { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 12px; }
.lv-bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.lv-bar i { display: block; height: 100%; background: var(--brand); }
.earn { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.earn div { background: var(--surface-2); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--text-2); }
.earn b { display: block; color: var(--brand-ink); font-size: 15px; }

/* 내 그룹 미니 */
.gmini { display: flex; flex-direction: column; }
.gmini a { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; }
.gmini a:first-child { border-top: 0; }
.gmini .gi { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; color: #fff; flex: none; font-size: 13px; }
.gmini span.t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* 내 게임 */
.mygames { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.mg { min-width: 0; }
.mg .thumb { aspect-ratio: 16 / 10; border-radius: 12px; position: relative; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.mg .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mg .thumb > .badge { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color: #fff; z-index: 1; }
.mg .st-pub { color: #3ddc97 !important; }
.mg .st-rev { color: #ffcf5a !important; }
.mg .st-rej { color: #ff8a80 !important; }
.mg b { display: block; margin-top: 10px; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg small { font-size: 12.5px; color: var(--text-3); display: flex; gap: 10px; margin-top: 2px; }
.mg-add { border: 2px dashed var(--line); border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: 13.5px; font-weight: 600; aspect-ratio: 16 / 10; }
.mg-add:hover { border-color: var(--brand); color: var(--brand-ink); }

/* 빠른 목록 */
.ql { display: flex; flex-direction: column; }
.ql a, .ql > div { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; min-width: 0; }
.ql > :first-child { border-top: 0; }
.ql .ti { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; color: var(--brand); flex: none; }
.ql .ti svg.lucide { width: 16px; height: 16px; }
.ql .tx { flex: 1; min-width: 0; }
.ql .tx > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql small { display: block; font-size: 12px; color: var(--text-3); }
.ql .r { margin-left: auto; font-size: 12px; color: var(--text-3); white-space: nowrap; }

table.dl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.dl th { text-align: left; font-size: 12px; color: var(--text-3); font-weight: 700; padding: 0 8px 10px; border-bottom: 1px solid var(--line); }
table.dl td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.dl tr:last-child td { border-bottom: 0; }
table.dl .redl { color: var(--brand-ink); font-weight: 700; font-size: 12.5px; white-space: nowrap; }

.noti a { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.5; }
.noti a:first-of-type { border-top: 0; }
.noti .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: none; }
.noti .dot.read { background: var(--surface-2); }
.noti small { display: block; font-size: 12px; color: var(--text-3); }

/* 그룹 카드 (마이페이지 · 둘러보기 공용) */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.gcard { padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.gcard:hover { border-color: var(--text-3); }
.gcard .top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.gcard .gi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 900; color: #fff; font-size: 18px; flex: none; }
.gcard h4 { font-size: 16px; letter-spacing: -0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gcard p { font-size: 13.5px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.gcard .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.gcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 그룹 ---------- */
.gp-head { margin-top: 28px; padding: 28px 32px; border-radius: 24px; border: 1px solid var(--line); background: radial-gradient(120% 160% at 100% 0%, var(--sky-soft), var(--surface) 55%); display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.gp-head .gi { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-weight: 900; color: #fff; font-size: 28px; flex: none; }
.gp-head h1 { font-size: 26px; letter-spacing: -0.04em; }
.gp-head .desc { color: var(--text-2); font-size: 14.5px; margin-top: 4px; }
.gp-head .meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; color: var(--text-3); align-items: center; }
.gp-head .acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gp-head form { display: contents; }
.gp-join { display: flex; gap: 8px; flex-wrap: wrap; }
.gp-join input { height: 40px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); padding: 0 14px; font: inherit; font-size: 13.5px; min-width: 200px; color: var(--text); }
.gp-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; margin: 24px 0 64px; }
.gp-body > div { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gp-boards { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.gp-members { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-members .pav { width: 34px; height: 34px; font-size: 13px; overflow: hidden; }
.gp-members .pav img { width: 100%; height: 100%; object-fit: cover; }
.gp-lock { padding: 40px 20px; text-align: center; color: var(--text-2); }
.gp-lock svg.lucide { width: 28px; height: 28px; color: var(--text-3); margin-bottom: 8px; }

.gtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0 16px; }
.gtabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 14px; font-weight: 700; color: var(--text-2); }
.gtabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.gtabs .n { font-size: 12px; opacity: .75; }
.gtabs .n.dot { background: var(--brand); color: var(--on-brand); border-radius: 99px; padding: 0 6px; opacity: 1; }
.mrows { display: flex; flex-direction: column; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.mrow:first-child { border-top: 0; }
.mrow .pav { width: 36px; height: 36px; font-size: 13px; overflow: hidden; }
.mrow .pav img { width: 100%; height: 100%; object-fit: cover; }
.mrow .who { flex: 1; min-width: 140px; }
.mrow .who b { display: block; font-size: 14.5px; }
.mrow .who small { font-size: 12.5px; color: var(--text-3); }
.mrow .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.mrow form { display: inline; }
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats4 div { background: var(--surface-2); border-radius: 14px; padding: 16px; }
.stats4 b { display: block; font-size: 24px; letter-spacing: -0.03em; }
.stats4 span { font-size: 12.5px; color: var(--text-3); }

@media (max-width: 1100px) {
  .my { grid-template-columns: 1fr; }
  .mnav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .mnav hr { display: none; }
  .mnav a, .mnav button { white-space: nowrap; width: auto; }
  .span4, .span3, .span2 { grid-column: span 6; }
  .prof .stats { margin-left: 0; }
  .gp-body { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .mygames { grid-template-columns: 1fr 1fr; }
  .earn, .stats4 { grid-template-columns: 1fr 1fr; }
  .prof, .gp-head { padding: 22px; }
  .prof .stats { gap: 18px; }
  .gp-head .acts { margin-left: 0; }
}
.gp-body > aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pav.has-img { background: var(--surface-2); }

/* ── 모바일 마이페이지 (≤760px): /my = 프로필 + 메뉴 목록, 하위 화면 = "‹ 제목" 머리줄 + 본문 ── */
.my-mtop, .mnav .chev { display: none; }
@media (max-width: 760px) {
  .my-page .my { gap: 0; margin-top: 16px; }
  /* /my : 메뉴를 세로 목록으로, 대시보드 본문은 숨김 */
  .my-page.is-home .dash { display: none; }
  .my-page.is-home .mnav { flex-direction: column; overflow: visible; gap: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 4px 0; }
  .my-page.is-home .mnav a[href="/my"] { display: none; }
  .my-page.is-home .mnav hr { display: block; border: 0; border-top: 8px solid var(--bg); margin: 4px 0; }
  .my-page.is-home .mnav a { width: 100%; min-height: 54px; padding: 0 16px; border-radius: 0; font-size: 15.5px; color: var(--text); white-space: normal; }
  .my-page.is-home .mnav a + a { border-top: 1px solid var(--line); }
  .my-page.is-home .mnav a.on { background: none; }
  .my-page.is-home .mnav a:active { background: var(--surface-2); }
  .my-page.is-home .mnav svg.lucide { width: 20px; height: 20px; color: var(--text-2); }
  .my-page.is-home .mnav .lb { flex: 1; min-width: 0; }
  .my-page.is-home .mnav .n { margin-left: 0; }
  .my-page.is-home .mnav .chev { display: block; width: 18px; height: 18px; color: var(--text-3); margin-left: 4px; }
  .my-page.is-home .mnav .out { color: var(--text-3); }
  .my-page.is-home .mnav .out .lb { color: var(--text-2); }
  /* 하위 화면: 프로필 · 메뉴 숨기고 머리줄 */
  .my-page.is-sub .prof, .my-page.is-sub .mnav { display: none; }
  .my-page.is-sub .my-mtop { display: flex; align-items: center; gap: 6px; margin: 12px -4px 0; }
  .my-mtop a { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
  .my-mtop a:active { background: var(--surface-2); }
  .my-mtop svg.lucide { width: 24px; height: 24px; }
  .my-mtop h1 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
  .my-page .prof { margin-top: 16px; }
  .my-page .prof .acts { width: 100%; }
  .my-page .prof .acts .btn { flex: 1; justify-content: center; }
}
/* 모바일 메뉴 목록 — 숨긴 대시보드 다음 첫 줄(스크랩)에는 윗줄 없음 */
@media (max-width: 760px) { .my-page.is-home .mnav a[href="/my"] + a { border-top: 0; } }
/* 모바일 프로필 통계 — 항목 수만큼 같은 너비로 (2개면 1:1) */
@media (max-width: 760px) {
  .prof .stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; gap: 8px; margin-left: 0; }
  .prof .stats > * { padding: 10px 4px; border-radius: 12px; background: rgb(255 255 255 / 6%); }
  :root[data-theme="light"] .prof .stats > * { background: rgb(255 255 255 / 70%); }
}
