/* ==========================================================
   components/modal.css — 모달 (모바일 바텀시트 → 데스크톱 가운데)
   .modal-dim > .modal(.modal-head / .modal-body / .modal-foot)
   모달 안에서 쓰는 .region-grid(지역 선택) · .share-*(친구에게 보내기)
   동작은 components/modal.js · components/share.js
   ========================================================== */

.modal-dim {
  position: fixed; inset: 0; z-index: 130; display: grid; align-items: end;
  background: rgba(29, 36, 51, .36); opacity: 0; pointer-events: none; transition: opacity .24s;
}
.modal-dim.open { opacity: 1; pointer-events: auto; }
.modal {
  width: 100%; max-height: 90vh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom); border-radius: 24px 24px 0 0; background: #fff;
  transform: translateY(100%); transition: transform .3s var(--ease);
}
.modal-dim.open .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 14px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.035em; }
.modal-sub { margin-top: 1px; font-size: 12.5px; color: var(--ink-3); }
.modal-body { min-height: 0; flex: 1; overflow-y: auto; padding: 16px; }
.modal-foot { padding: 12px 16px 16px; border-top: 1px solid var(--line); }
body.modal-open { overflow: hidden; }

@media (min-width: 768px) {
  .modal-dim { place-items: center; }
  .modal { max-width: 480px; border-radius: 24px; transform: translateY(20px) scale(.98); }
  .modal-dim.open .modal { transform: none; }
}

/* ---------- 지역 선택 그리드 (모달 · 홈 바로가기 공통) ---------- */
.region-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.region-grid button, .region-grid a {
  height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 15px; font-weight: 700; color: var(--ink-2); transition: all .15s;
}
.region-grid button:hover, .region-grid a:hover { box-shadow: inset 0 0 0 1.5px var(--line-hover); color: var(--ink); }
.region-grid [aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: none; }
@media (min-width: 520px) { .region-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 친구에게 보내기: 미리보기 카드 ---------- */
.share-card {
  position: relative; overflow: hidden; padding: 20px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(260px 160px at 100% 0%, rgba(255, 150, 66, .55) 0%, rgba(255, 150, 66, 0) 70%),
    linear-gradient(150deg, var(--navy-hover) 0%, var(--navy) 100%);
}
.share-card .sc-top { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, .72); }
.share-card .sc-top svg { width: 22px; height: 22px; }
.share-card .sc-name { margin-top: 14px; font-size: 20px; font-weight: 800; letter-spacing: -.035em; }
.share-card .sc-rank { margin-top: 2px; font-size: 32px; font-weight: 900; letter-spacing: -.05em; line-height: 1.2; }
.share-card .sc-rank em { font-style: normal; color: var(--peach); }
.share-card .sc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.share-card .sc-meta span {
  height: 26px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, .12); font-size: 12.5px; font-weight: 700;
}
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.share-url {
  display: flex; align-items: center; gap: 8px; height: 46px; margin-top: 12px; padding: 0 14px;
  border-radius: 13px; background: var(--surface-2); font-size: 13px; color: var(--ink-3);
}
.share-url span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
