/* ══════════════════════════════════════
   BackPoint v3 — style.css
   다크 테마 · 모바일 우선 · 컴팩트 전신
   ══════════════════════════════════════ */

.mpc-page {
  background: #0b0c10;
  min-height: 100vh;
}
.mpc-page, .mpc-page * { color: #f5f7fb; }
.mpc-page .subtitle, .mpc-page .legend, .mpc-page .foot,
.mpc-page .info-p, .mpc-page .info-list, .mpc-page .info-tip {
  color: #d6d9e0;
}
.mpc-page .title, .mpc-page h3 { color: #fff; }

.top { text-align: center; padding: 12px 12px 6px; }
.title { font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.subtitle { font-size: 11px; opacity: .7; }

.wrap { max-width: 420px; margin: 0 auto; padding: 10px; }
.card { background: #12141a; border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.card-title { font-size: 14px; font-weight: 800; margin-bottom: 12px; color: #c7d2fe !important; }

/* ── 보드 (컴팩트 전신) ── */
.board {
  position: relative;
  aspect-ratio: 300 / 500;
  max-width: 280px;
  margin: 0 auto;
}

.back {
  width: 100%; height: 100%;
  fill: rgba(255,255,255,.08);
  stroke: rgba(255,255,255,.18);
  stroke-width: 1.2;
}

/* ★ 캔버스: touch-action 제거 → 스크롤 가능 */
#paintCanvas {
  position: absolute; inset: 0;
  z-index: 4;
  /* touch-action: none 제거! 브라우저 스크롤 허용 */
}

.grid {
  position: absolute; inset: 0;
  display: none; pointer-events: none !important; z-index: 3;
  background:
    linear-gradient(to right, rgba(255,255,255,.12) 1px, transparent 1px) 0 0 / 10% 100%,
    linear-gradient(to bottom, rgba(255,255,255,.12) 1px, transparent 1px) 0 0 / 100% 5%;
}
.grid.on { display: block; }
.back { z-index: 1; }

/* ── 컨트롤 ── */
.controls {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 10px;
}
.btn {
  padding: 12px; border-radius: 12px;
  background: #2a2f3a !important;
  border: 1px solid rgba(255,255,255,.25) !important;
  color: #fff !important; font-weight: 700;
  font-size: 13px; cursor: pointer;
  transition: transform .1s, filter .1s;
  text-align: center; text-decoration: none;
}
.btn:active { transform: scale(.97); filter: brightness(1.1); }
.btn-primary { background: #1f6fff !important; border-color: #1f6fff !important; }
.btn-save { background: #059669 !important; border-color: #059669 !important; }
.btn-stats { background: #6366f1 !important; border-color: #6366f1 !important; }

.legend {
  grid-column: 1 / -1; text-align: center;
  font-size: 11px; font-weight: 600; opacity: .7;
}
.dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin: 0 3px;
}
.dot.l { background: rgba(255,80,80,.4); }
.dot.m { background: rgba(255,50,50,.65); }
.dot.s { background: rgba(255,0,0,.9); }

.coord {
  grid-column: 1 / -1; text-align: center;
  margin-top: 2px; font-size: 11px;
  font-weight: 800; letter-spacing: .6px; opacity: .92;
}

/* ── 안내 카드 ── */
.info-card { font-size: 12px; line-height: 1.7; }
.info-title { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.info-list { padding-left: 16px; margin: 6px 0; }
.info-list li { margin-bottom: 3px; }
.info-tip { font-size: 11px; opacity: .6; margin-top: 6px; }
.foot { text-align: center; font-size: 10px; opacity: .5; padding: 6px 0 12px; }

/* ── 동의 모달 ── */
.consent-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.consent-modal {
  background: #1a1d25; border-radius: 20px;
  padding: 24px 20px; max-width: 400px; width: 100%;
  border: 1px solid rgba(255,255,255,.1);
}
.consent-icon { text-align: center; font-size: 36px; margin-bottom: 10px; }
.consent-title {
  text-align: center; font-size: 16px; font-weight: 800;
  margin-bottom: 14px; color: #fff !important;
}
.consent-body { font-size: 12px; line-height: 1.8; color: #d0d5dd !important; }
.consent-body p { margin: 6px 0; }
.consent-body ul { padding-left: 18px; margin: 4px 0 8px; }
.consent-body li { margin-bottom: 2px; }
.consent-body b { color: #e5e7eb !important; }
.consent-note {
  font-size: 11px; opacity: .7; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08);
}
.consent-actions {
  display: flex; flex-direction: column; gap: 8px; margin-top: 16px;
}
.btn-consent {
  padding: 14px; border-radius: 12px; border: none;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .1s;
}
.btn-consent:active { transform: scale(.97); }
.btn-consent-yes { background: #059669; color: #fff; }
.btn-consent-no { background: #374151; color: #d1d5db; }

/* ── 토스트 ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .3s; z-index: 999;
  background: #1e293b; color: #fff;
  border: 1px solid rgba(255,255,255,.15);
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; pointer-events: auto; }
.toast-ok { background: #065f46; border-color: #059669; }
.toast-error { background: #7f1d1d; border-color: #ef4444; }
.toast-warn { background: #78350f; border-color: #f59e0b; }

/* ══════════════════════════════════════
   통계 페이지
   ══════════════════════════════════════ */

.stat-summary {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.stat-box {
  background: #12141a; border-radius: 16px;
  padding: 16px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 800; color: #818cf8 !important; }
.stat-label { font-size: 12px; color: #9ca3af !important; margin-top: 4px; }

.region-bars { display: flex; flex-direction: column; gap: 8px; }
.region-bar-row { display: flex; align-items: center; gap: 8px; }
.region-label { width: 80px; font-size: 12px; font-weight: 600; text-align: right; flex-shrink: 0; }
.region-bar-track {
  flex: 1; height: 20px; background: rgba(255,255,255,.06);
  border-radius: 6px; overflow: hidden;
}
.region-bar-fill {
  height: 100%; background: linear-gradient(90deg, #ef4444, #f97316);
  border-radius: 6px; min-width: 3px;
  transition: width .5s ease;
}
.region-bar-fill.bar-blue {
  background: linear-gradient(90deg, #6366f1, #818cf8);
}
.region-count { width: 36px; font-size: 12px; opacity: .7; text-align: right; }

.empty-msg { text-align: center; font-size: 13px; opacity: .5; padding: 16px; }

.cross-area { margin-bottom: 14px; }
.cross-area-name {
  font-size: 13px; font-weight: 800; margin-bottom: 6px;
  color: #a5b4fc !important;
}
.cross-row {
  display: flex; justify-content: space-between;
  font-size: 12px; padding: 3px 8px;
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.cross-label { opacity: .8; }
.cross-val { font-weight: 700; color: #fbbf24 !important; }

.my-session-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.04);
}
.my-session-date {
  font-size: 12px; font-weight: 700; opacity: .6;
  width: 70px; flex-shrink: 0;
}
.my-session-hits { display: flex; flex-wrap: wrap; gap: 4px; }
.hit-tag {
  font-size: 11px; padding: 2px 8px;
  background: rgba(99,102,241,.2); border-radius: 8px;
  white-space: nowrap;
}