/* 24K CLUB 회원 웹 — 지도 기반.
 *
 * 토큰은 앱 디자인 v4.4 그대로다(검정·흰색·골드 #F5C542, Pretendard).
 * **한 코드로 PC 와 폰을 다 본다.** 폰은 지도 위에 카드가 올라오고,
 * PC 는 지도 옆에 목록이 선다 — 화면 넓이 하나로 갈린다.
 */

:root {
  --bg: #f4f4f5;
  --card: #fff;
  --ink: #111214;
  --sub: #7a7d85;
  --line: #ececef;
  --y: #f5c542;
  --y2: #ffe38a;
  --point: #b7860b;
  --night: #0e0e11;
  --night2: #1a1a1f;
  --night-line: #26262c;
  --night-sub: #8d9099;
  --night-body: #c8cad1;
  --green: #22c55e;
  --red: #ff4d4f;
  --chip-bg: #f1f1f3;
  --chip-ink: #44464c;
  --dim-bg: #e4e4e7;
  --dim-ink: #a1a4ad;
  --soft: #f7f7f8;
  --warn-bg: #fff6d6;
  --warn-ink: #5a4200;
  --warn-line: #f0e2b0;
  --danger-bg: #ffeded;
  --danger-line: #f3c2c2;
  --danger-ink: #c2262a;
  --danger-sub: #7a2a2c;
  --request-bg: #fff9e6;

  --tabbar: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", -apple-system, sans-serif;
  line-height: 1.45;
  letter-spacing: -0.1px;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }

.n { font-weight: 800; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; }
.sub { color: var(--sub); }
.hide { display: none !important; }

/* — 판 — */

.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

.stage { position: relative; flex: 1; min-height: 0; display: flex; }

#map { flex: 1; min-width: 0; background: #e9e9eb; }

/* 지도가 못 뜬 자리. **회색 판만 남기지 않는다** — 왜 안 떴는지 말한다.
 *
 * `display:flex` 는 브라우저 기본 `[hidden]{display:none}` 을 **이긴다.**
 * 그래서 숨긴 줄 알았던 투명한 판이 화면 전체를 덮고 지도 클릭을 먹었다.
 * 아래 한 줄이 없으면 라이브에서 아이콘이 안 눌린다. */
.mapfail[hidden] { display: none !important; }

.mapfail {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: var(--night);
  color: #fff;
  z-index: 5;
}
.mapfail b { font-size: 16px; }
.mapfail span { font-size: 12.5px; color: var(--night-sub); max-width: 320px; line-height: 1.6; }

/* 카카오지도가 아닌 것으로 그리고 있을 때 뜨는 띠.
   숨기지 않는다 — 조용히 다른 지도를 쓰면 나중에 확인할 방법이 없다. */
.mapnotice {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 5;
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-line);
  color: var(--warn-ink);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 11.5px;
  line-height: 1.5;
}

/* — 상단 — */

.top {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  padding: 10px 12px 0;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  pointer-events: none;
}
.top > * { pointer-events: auto; }

.brand {
  background: var(--night);
  color: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.brand b { display: block; font-size: 15px; letter-spacing: -0.4px; }
.brand b i { background: var(--y); color: #111; font-style: normal; padding: 0 5px; border-radius: 6px; }
.brand .max { color: var(--y); font-size: 20px; font-weight: 800; letter-spacing: -0.8px; }
.brand .max small { font-size: 11px; font-weight: 700; letter-spacing: 0; }
.brand .why { font-size: 11px; color: var(--night-sub); }

.filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  padding: 2px 0;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  background: #fff;
  border-radius: 20px;
  padding: 7px 13px;
  font-size: 12px;
  color: var(--sub);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; font-weight: 700; }

.sos {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-weight: 800;
  font-size: 16px;
  border: 1.5px solid #ffd5d6;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  flex: none;
}

/* — 지도 위 아이콘 — */
/* 카카오 CustomOverlay 안에 들어가는 조각이다. 클릭이 DOM 으로 오기 때문에
   캔버스 위 좌표를 계산할 필요가 없다 — 표식을 「누를 수 있는 것」으로 만드는 핵심. */

.pin {
  transform: translate(-50%, -100%);
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}
.pin .body {
  background: var(--night);
  color: #fff;
  border-radius: 14px;
  padding: 6px 9px 7px;
  min-width: 74px;
  text-align: center;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
}
.pin .amt { color: var(--y); font-size: 15px; font-weight: 800; letter-spacing: -0.5px; }
.pin .amt small { font-size: 10px; letter-spacing: 0; }
.pin .nm {
  font-size: 10.5px;
  color: var(--night-body);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pin .tail {
  width: 10px; height: 10px;
  background: var(--night);
  margin: -6px auto 0;
  transform: rotate(45deg);
  border-right: 1.5px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.12);
}
.pin.on .body { background: var(--y); border-color: var(--y); }
.pin.on .amt { color: #111; }
.pin.on .nm { color: #4a3a06; }
.pin.on .tail { background: var(--y); border-color: var(--y); }
/* 겹쳐서 못 고르는 자리는 미리 회색으로 말한다. 눌러 봐야 알게 하지 않는다. */
.pin.blocked .body { background: #5b5b62; }
.pin.blocked .amt { color: #d6d6da; }
.pin.blocked .tail { background: #5b5b62; }

/* 묶음 아이콘 — 몇 곳이 겹쳤는지를 숫자로 말한다. */
.pin.many .body { background: #2b2b33; border-color: var(--y); }
.pin .cnt {
  display: inline-block;
  margin-left: 4px;
  background: var(--y);
  color: #111;
  font-size: 9.5px;
  font-weight: 800;
  border-radius: 6px;
  padding: 1px 5px;
  vertical-align: 2px;
  letter-spacing: 0;
}

/* 실존 클럽(미제휴) 표시.
 *
 * **캠페인 아이콘과 확실히 다르게 생겨야 한다.** 이 가게들은 24K 와 계약한 곳이 아니라
 * 이름과 자리만 얹은 것이라, 포인트 아이콘과 비슷하면 제휴한 것처럼 읽힌다.
 * 그래서 골드를 쓰지 않고, 작은 점 + 흰 이름표로 낮게 깐다. */
.venue {
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.venue i {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #6b6e78;
  flex: none;
}
.venue span {
  font-size: 10.5px;
  font-weight: 600;
  color: #33353b;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  padding: 1px 5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.venue:hover span, .venue:focus span { background: #fff; color: var(--ink); }

.filters .venue-toggle[aria-pressed="true"] { background: #33353b; color: #fff; }

/* 내 위치 — 파란 점 하나. 매장 아이콘과 색이 겹치면 안 된다. */
.me { transform: translate(-50%, -50%); }
.me i {
  display: block;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  border: 3px solid #fff;
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.22), 0 2px 6px rgba(0, 0, 0, 0.3);
}

.locate {
  position: absolute;
  right: 12px;
  bottom: 16px;
  z-index: 5;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  display: flex; align-items: center; justify-content: center;
}
.locate svg { width: 22px; height: 22px; }
.locate[aria-pressed="true"] { color: #3b82f6; }
.locate.busy { opacity: 0.5; }

.toast {
  position: absolute;
  left: 12px; right: 12px; bottom: 70px;
  z-index: 8;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

/* — 카드(폰) / 목록(PC) — */

.panel {
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.14);
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  max-height: 72%;
  display: flex;
  flex-direction: column;
  transform: translateY(0);
  transition: transform 0.22s ease;
}
.panel[hidden] { display: flex !important; transform: translateY(110%); pointer-events: none; }
.panel .handle {
  width: 40px; height: 4px;
  background: #dddee3;
  border-radius: 2px;
  margin: 10px auto 6px;
  flex: none;
}
.panel .body { overflow-y: auto; padding: 4px 16px 16px; }

@media (prefers-reduced-motion: reduce) {
  .panel { transition: none; }
}

/* — 카드 조각 — */

.photo { border-radius: 14px; overflow: hidden; position: relative; background: #222; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo .tag {
  position: absolute; left: 10px; top: 10px;
  font-size: 10px; background: rgba(0, 0, 0, 0.55); color: #fff;
  padding: 3px 7px; border-radius: 7px;
}
.photo .live {
  position: absolute; left: 10px; bottom: 10px;
  font-size: 10px; background: var(--red); color: #fff;
  padding: 2px 7px; border-radius: 6px; font-weight: 700;
}

.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.name { font-size: 17px; font-weight: 800; letter-spacing: -0.4px; }
.amount { font-size: 26px; font-weight: 800; color: var(--point); letter-spacing: -0.8px; }
.amount small { font-size: 13px; letter-spacing: 0; }
.cond { font-size: 12px; color: var(--sub); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  font-size: 10.5px; padding: 3px 8px; border-radius: 8px;
  background: var(--chip-bg); color: var(--chip-ink); font-weight: 500;
}
.chip.g { background: #e7f8ee; color: #157a3c; }
.chip.y { background: var(--y2); color: #5a4200; }
.chip.r { background: var(--danger-bg); color: var(--danger-ink); }
.chip.k { background: var(--ink); color: #fff; }
.chip.dim { background: var(--dim-bg); color: #6b6e78; }

.kv {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px;
}
.kv:last-child { border: 0; }
.kv span { color: var(--sub); flex: none; }
.kv b { font-weight: 600; text-align: right; }

.notice {
  background: var(--ink); color: #fff; border-radius: 14px;
  padding: 10px 12px; font-size: 11.5px; line-height: 1.5; margin: 10px 0;
}

.tile {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 14px;
  background: var(--request-bg); margin-bottom: 6px;
}
.tile i {
  width: 30px; height: 30px; border-radius: 10px; background: var(--y);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-style: normal; flex: none;
}
.tile b { display: block; font-size: 12px; }
.tile span { font-size: 11px; color: var(--sub); }

.btn {
  display: block; width: 100%;
  padding: 14px; border-radius: 14px;
  background: var(--ink); color: #fff;
  font-weight: 700; font-size: 14px; letter-spacing: -0.2px; text-align: center;
}
.btn.y { background: var(--y); color: #111; }
.btn.gh { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.dim { background: var(--dim-bg); color: var(--dim-ink); cursor: not-allowed; }
.btn.row2 { display: inline-block; width: auto; flex: 1; padding: 11px; font-size: 12px; }

.warn {
  background: var(--warn-bg); border-radius: 14px;
  padding: 10px 12px; margin: 8px 0;
}
.warn b { font-size: 12.5px; color: var(--warn-ink); }
.warn .kv { border-color: var(--warn-line); font-size: 11px; }
.warn .kv span { color: #7a5a12; }

.danger {
  background: var(--danger-bg); border: 1.5px solid var(--danger-line);
  border-radius: 14px; padding: 12px;
}
.danger b { color: var(--danger-ink); font-size: 13px; }
.danger p { margin: 4px 0 0; font-size: 11.5px; color: var(--danger-sub); line-height: 1.5; }

/* — 하단 카테고리 — 그대로 유지한다(오늘·예약·채팅·지갑·MY) — */

.tabs {
  flex: none;
  height: calc(var(--tabbar) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: #fff;
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 7;
}
.tabs button {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--dim-ink);
}
.tabs button svg { width: 22px; height: 22px; }
.tabs button[aria-selected="true"] { color: var(--ink); font-weight: 700; }

/* — 다른 탭 — */

.page { position: absolute; inset: 0; background: var(--bg); overflow-y: auto; z-index: 8; }
.page .inner { padding: 16px; max-width: 720px; margin: 0 auto; }
.page h2 { margin: 6px 0 12px; font-size: 20px; letter-spacing: -0.5px; }
.card { background: #fff; border-radius: 18px; padding: 14px; margin-bottom: 10px; }

/* — 탭 화면 조각 — */

/* 현장에서 쓰는 카드만 밤 모드다. 테마 토글이 아니라 **화면 종류**다. */
.card.night { background: var(--night); color: #fff; }
.card.night .cond { color: var(--night-body); }
.card.night .cond.dim { color: var(--night-sub); }
.card.soft { background: var(--soft); }

.chip.night { background: var(--night-line); color: var(--night-body); }

.storename { font-size: 17px; font-weight: 700; margin-top: 8px; }
.n.big { font-size: 34px; margin: 6px 0; }
.n.big small { font-size: 16px; letter-spacing: 0; }
.n.huge { font-size: 42px; margin: 4px 0 2px; color: #fff; }
.n.huge small { font-size: 18px; letter-spacing: 0; }

/* 체크인 창이 열리기 전에는 누를 게 없다 — 버튼이 아니라 안내 띠다. */
.strip {
  margin-top: 14px;
  padding: 10px;
  border-radius: 12px;
  background: var(--night-line);
  color: var(--night-body);
  text-align: center;
  font-size: 11.5px;
}

.acts {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--night-sub);
  flex-wrap: wrap;
}

.av {
  width: 34px; height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffb6c1, #ffd966);
  flex: none;
}

.qrbox {
  width: 150px; height: 150px;
  margin: 10px auto;
  border-radius: 14px;
  border: 10px solid #fff;
  background:
    repeating-linear-gradient(90deg, #111 0 8px, transparent 8px 16px),
    repeating-linear-gradient(0deg, #111 0 8px, #fff 8px 16px);
}
.card.qr { text-align: center; }

/* — PC — 지도 옆에 목록이 선다 — */

@media (min-width: 900px) {
  /* PC 에서도 지도가 화면을 다 쓴다. 고른 매장 카드는 지도 **위에** 뜬다 —
     옆에 붙여 세우면 아무것도 안 골랐을 때도 지도가 그만큼 좁아진다. */
  .panel {
    left: auto;
    right: 16px;
    top: 16px;
    bottom: 16px;
    width: 380px;
    max-height: none;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  }
  .panel[hidden] { transform: translateX(120%); }
  .panel .handle { display: none; }
  .panel .body { padding: 16px; }
  .tabs {
    height: 64px;
    justify-content: center;
    gap: 8px;
  }
  .tabs button { flex: none; width: 96px; }
  .top { padding: 14px 16px 0; }
  .brand .max { font-size: 24px; }
}
