/* 로또 6/45 — A안 · 미니멀 핀테크 화이트
   배경 #F4F6F9 · 순백 카드 · 22px 라운드 · 로열 블루 #2F5BFF 포인트 */
:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #191f28;
  --ink-soft: #4e5968;
  --ink-faint: #8b95a1;
  --line: #eff3f8;
  --line-strong: #e4eaf2;
  --brand: #2f5bff;
  --brand-dark: #2350f0;
  --brand-soft: #eef3ff;
  --ok: #12b76a;
  --warn: #b8860b;
  --danger: #d6455d;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 2px 10px rgba(23, 40, 77, 0.045);
  --shadow-soft: 0 1px 4px rgba(23, 40, 77, 0.1);
  --ball-1: #f0ae12;
  --ball-2: #3d7df2;
  --ball-3: #e8564f;
  --ball-4: #6e7887;
  --ball-5: #28a97a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.03em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--brand); }

/* ---------- 앱 셸 ---------- */
.app {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 6px 18px 34px;
  min-height: 100vh;
}
.app-main { display: block; }

/* ---------- header ---------- */
.head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 2px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-badge {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3f6bff, #2046e0);
  color: #fff;
  font-size: 11.5px; font-weight: 800; letter-spacing: -0.02em;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(47, 91, 255, 0.28);
  flex: none;
}
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 17.5px; font-weight: 800; }
.brand-text p { margin-top: 2px; font-size: 11.5px; color: var(--ink-faint); font-weight: 500; }

.data-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: 0 1px 2px rgba(23, 40, 77, 0.04);
  white-space: nowrap;
  flex: none;
}
.data-pill .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ok);
  display: block;
}
.data-pill.stale .dot { background: #f0ae12; }
.data-pill.error .dot { background: var(--ball-3); }

/* ---------- cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.hidden { display: none !important; }

/* ---------- 최신 당첨번호 ---------- */
.latest-card { padding-bottom: 16px; }
.latest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand);
}
.latest-head h2 { font-size: 18px; font-weight: 800; margin-top: 3px; }
.muted { color: var(--ink-faint); font-size: 12px; margin-top: 1px; }
.latest-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}

.ball-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  align-items: center;
  justify-content: center;
}
.ball-row .plus { font-size: 15px; color: var(--ink-faint); padding: 0 1px; }

/* ---------- 로또 볼 ---------- */
.ball {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  color: #fff;
  box-shadow: 0 3px 7px rgba(24, 40, 80, 0.16);
  flex: 0 0 auto;
  position: relative;
  font-variant-numeric: tabular-nums;
}
.ball.g1 { background: var(--ball-1); }
.ball.g2 { background: var(--ball-2); }
.ball.g3 { background: var(--ball-3); }
.ball.g4 { background: var(--ball-4); }
.ball.g5 { background: var(--ball-5); }
.ball.lg { width: 42px; height: 42px; font-size: 15.5px; }
.ball.sm { width: 30px; height: 30px; font-size: 12.5px; }
.ball.fixed { box-shadow: 0 0 0 2px #fff, 0 0 0 3.6px #bfd0ff, 0 3px 7px rgba(24, 40, 80, 0.12); }
.ball.bonus::after {
  content: "보너스";
  position: absolute;
  bottom: -15px;
  font-size: 9px;
  color: var(--ink-faint);
  font-weight: 700;
  white-space: nowrap;
}
.ball.matched { outline: 2.5px solid var(--brand); outline-offset: 2.5px; }
.ball.hit-bonus { outline: 2.5px solid var(--ball-3); outline-offset: 2.5px; }

/* ---------- buttons ---------- */
.btn-primary {
  width: 100%;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(100deg, #3f6bff, #2350f0);
  color: #fff;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding: 16px;
  box-shadow: 0 10px 22px rgba(47, 91, 255, 0.26);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47, 91, 255, 0.32); }
.btn-primary:active { transform: translateY(1px) scale(0.998); }
.btn-primary.small { width: auto; padding: 11px 18px; font-size: 14px; border-radius: 12px; }
.btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; }
.card > .btn-primary { margin-top: 14px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  color: #2557f5;
  background: #f6f9ff;
  border: 1px solid #d6e1fb;
  text-decoration: none;
  white-space: nowrap;
  flex: none;
}
.btn-ghost:hover { background: #eef4ff; }

.mini-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 9px;
  transition: background 0.12s ease, color 0.12s ease;
}
.mini-btn:hover { background: #f5f7fb; color: var(--ink); }
.mini-btn.danger { color: var(--danger); border-color: #f6d7dd; background: #fff7f8; }

.icon-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 15px;
  color: var(--ink-soft);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex: none;
}
.icon-btn:hover { background: #f5f7fb; }

/* ---------- tabs ---------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  background: #e7ecf3;
  border-radius: 14px;
  padding: 4px;
  margin: 2px 0 12px;
}
.tab {
  height: 40px;
  border: 0;
  background: none;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(23, 40, 77, 0.08); }
.tab-count {
  min-width: 20px; height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #edf1f7;
  color: #7b8595;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
}
.tab.active .tab-count { background: #e9efff; color: var(--brand); }

.panel { display: none; }
.panel.active { display: block; }

/* ---------- fields ---------- */
.field { padding: 13px 0; border-bottom: 1px solid #f1f4f8; }
.field:first-child { padding-top: 1px; }
.field:last-of-type { border-bottom: 0; padding-bottom: 2px; }
.field.inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 0;
  padding-top: 0;
}
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #343d4c;
}
.field.inline .field-label { margin-bottom: 0; }
.hint { font-style: normal; color: #a3adbb; font-weight: 500; font-size: 11px; }

.segmented {
  display: inline-flex;
  gap: 4px;
  background: #f2f5f9;
  border-radius: 11px;
  padding: 3px;
}
.seg {
  height: 32px;
  padding: 0 15px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-faint);
}
.seg.active { background: #fff; color: var(--brand); box-shadow: 0 1px 4px rgba(23, 40, 77, 0.1); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; align-items: center; margin-top: 9px; }
.chips-empty { font-size: 12.5px; color: #b4bcc7; font-weight: 500; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
}
.chip .ball.sm {
  width: 32px; height: 32px;
  font-size: 13px;
  box-shadow: none;
}
.chips.chips-fixed .chip .ball.sm {
  background: var(--brand-soft);
  color: #2557f5;
  border: 1px solid #d7e2ff;
}
.chips.chips-excluded .chip .ball.sm {
  background: #f5f7fa;
  color: #b4bcc7;
  border: 1px solid #ebeff5;
  text-decoration: line-through;
}
.chip button {
  border: 0;
  background: transparent;
  color: #b4bcc7;
  font-size: 12px;
  padding: 0 2px;
  line-height: 1;
}
.chip button:hover { color: var(--ink-soft); }

.select, .input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
}
.select { width: auto; min-width: 150px; max-width: 62%; }
.select:focus, .input:focus { outline: 2px solid rgba(47, 91, 255, 0.28); border-color: var(--brand); }

.exclusion-note {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.5;
}

/* ---------- 추출 조건 ---------- */
.condition-box {
  margin-top: 12px;
  background: #f7f9fc;
  border-radius: var(--radius-sm);
  padding: 12px 13px;
}
.condition-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 9px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}
.condition-title em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  color: #9aa4b2;
}
.condition-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.condition-box li {
  font-size: 10.5px;
  font-weight: 600;
  color: #6b7684;
  background: #fff;
  border: 1px solid #e6ebf2;
  border-radius: 7px;
  padding: 4px 7px;
  line-height: 1.35;
  white-space: nowrap;
}
.condition-box li b { color: #4e5968; font-weight: 700; }
.condition-box li .cond-meta { font-size: 10px; color: #a3adbb; }
.condition-box li .cond-meta.off { color: var(--ball-3); font-weight: 700; }

/* ---------- 뽑은 번호 결과 ---------- */
.result-card { padding-bottom: 14px; }
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.result-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.result-title h3 { font-size: 16.5px; font-weight: 800; }
.result-title span { font-size: 11.5px; font-weight: 600; color: #9aa4b2; }
.result-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.share-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid #d6e1fb;
  background: #f6f9ff;
  color: #2557f5;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.share-pill:hover { background: #eef4ff; }
.share-pill:active { transform: scale(0.98); }

.game-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 11px 0;
  border-top: 1px solid #f3f5f9;
}
.game-row:first-of-type { border-top: 0; }
.g-label {
  width: 26px; height: 26px;
  border-radius: 9px;
  background: #f2f5f9;
  color: #7b8595;
  font-size: 11px;
  font-weight: 800;
  display: grid; place-items: center;
  flex: none;
}
.g-balls { display: flex; gap: 6px; min-width: 0; flex-wrap: wrap; }
.g-actions { display: flex; gap: 6px; margin-left: auto; flex: none; }
.g-actions .mini-btn { padding: 6px 10px; font-size: 11.5px; color: var(--ink-faint); border-color: #eef1f6; }

.all-save {
  width: 100%;
  margin-top: 4px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: #f7f9fc;
  color: #7b8595;
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.all-save:hover { background: #eef2f8; color: var(--ink-soft); }

.draw-status {
  margin-top: 10px;
  font-size: 11px;
  font-weight: 600;
  color: #12b76a;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  line-height: 1.45;
}
.draw-status::before { content: "✓"; font-weight: 800; flex: none; }

/* ---------- 내 번호 ---------- */
.saved-list { display: grid; gap: 10px; margin-bottom: 12px; }
.saved-item { padding: 16px; margin-bottom: 0; }
.saved-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.saved-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-faint); }
.round-tag {
  background: var(--brand-soft);
  color: #2557f5;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
}
.rank-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f2f5f9;
  color: var(--ink-soft);
}
.rank-badge.rank-1 { background: #fff6dc; color: #96690a; }
.rank-badge.rank-2 { background: #eaf2ff; color: #1a58c6; }
.rank-badge.rank-3 { background: #ffedec; color: #bb2d22; }
.rank-badge.rank-4 { background: #f1f4f8; color: #525b6b; }
.rank-badge.rank-5 { background: #eafaf1; color: #0d7f4a; }
.rank-badge.pending { background: #fff8e8; color: #a2760a; }

.saved-balls { display: flex; gap: 6px; flex-wrap: wrap; }
.saved-memo { margin-top: 9px; font-size: 12.5px; color: var(--ink-soft); }
.saved-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.judge-line { margin-top: 9px; font-size: 11.5px; color: var(--ink-faint); line-height: 1.5; }

.empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.6;
}
.empty strong { display: block; font-size: 14.5px; color: var(--ink-soft); margin-bottom: 6px; }

.summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.summary-stat {
  flex: 1 1 80px;
  background: #f7f9fc;
  border-radius: 12px;
  padding: 10px 12px;
}
.summary-stat b { display: block; font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.summary-stat span { font-size: 11px; color: var(--ink-faint); font-weight: 500; }

.row-actions { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- 동기화 ---------- */
.sync-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sync-head h3 { font-size: 15px; font-weight: 800; }
.badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef1f6;
  color: var(--ink-soft);
}
.badge.on { background: #eafaf2; color: var(--ok); }
.badge.off { background: #fff8e8; color: #a2760a; }
.sync-desc { margin-top: 8px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }
.auth-form { display: grid; gap: 8px; margin-top: 12px; }
.auth-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.auth-signed { margin-top: 12px; display: grid; gap: 8px; }
.auth-msg {
  margin: 2px 0 0;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  background: #eef1f6;
  color: var(--ink-soft);
}
.auth-msg.error { background: #fff0ef; color: #b3261e; }
.auth-msg.ok { background: #eafaf2; color: #0b7a48; }
.auth-msg.info { background: #eef4ff; color: #1b4bb8; }
.auth-help { margin-top: 2px; font-size: 11.5px; color: var(--ink-faint); }
.auth-help summary { cursor: pointer; font-weight: 700; padding: 4px 0; }
.auth-help ul { margin: 6px 0 0; padding-left: 16px; line-height: 1.55; }
.auth-help li { margin-bottom: 5px; }
.auth-help em { font-style: normal; font-weight: 700; color: var(--ink-soft); }
.signed-email { font-size: 13px; font-weight: 700; }
.fine { margin-top: 10px; font-size: 11px; color: var(--ink-faint); line-height: 1.5; }

/* ---------- 가까운 로또 판매점 찾기 · 카카오맵 ---------- */
.store-card { padding-bottom: 16px; }
.store-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.store-head h3 { font-size: 16.5px; font-weight: 800; margin-top: 3px; }
.store-badge {
  flex: none;
  margin-top: 2px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: #fff8e8;
  color: #a2760a;
  white-space: nowrap;
}
.store-badge.on { background: #eafaf2; color: #0d7f4a; }
.store-desc { margin-top: 6px; font-size: 12px; color: var(--ink-faint); line-height: 1.5; }

.store-search { display: flex; gap: 6px; margin-top: 12px; }
.store-search .input { flex: 1; min-width: 0; font-size: 13.5px; padding: 9px 11px; }
.store-search-btn {
  flex: none;
  height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border-color: #d6e1fb;
  background: var(--brand-soft);
  color: #2557f5;
}
.store-search-btn:hover { background: #e7efff; color: #1b47d8; }

.store-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.locate-btn {
  flex: 1 1 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #343d4c;
  font-size: 12.5px;
  font-weight: 800;
}
.locate-btn:hover { background: #f7f9fc; }
.locate-btn:disabled { opacity: 0.6; cursor: default; }
.locate-btn.busy { color: var(--ink-faint); }
.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 38px;
  padding: 0 12px;
  border-radius: 11px;
  text-decoration: none;
  font-size: 12px;
  white-space: nowrap;
}

/* 지도 표시 영역 — 모바일 280px / PC 380px, 1px 보더 · 둥근 모서리 */
.kakao-map {
  position: relative;
  margin-top: 10px;
  height: 280px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  overflow: hidden;
  background-color: #f6f8fc;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 23px, #e9eef7 23px 24px),
    repeating-linear-gradient(90deg, transparent 0 23px, #e9eef7 23px 24px);
}
.kakao-map.has-map { background-image: none; }

.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 18px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(246, 248, 252, 0.74), rgba(246, 248, 252, 0.94));
}
.map-placeholder[hidden] { display: none !important; }
.map-pin {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: #eef3ff;
  color: var(--brand);
  font-size: 19px;
  margin-bottom: 2px;
  box-shadow: 0 6px 14px rgba(47, 91, 255, 0.16), inset 0 0 0 1px #dbe6ff;
}
.map-placeholder-title { font-size: 12.5px; font-weight: 800; color: #343d4c; line-height: 1.45; max-width: 260px; }
.map-placeholder-sub { font-size: 11px; font-weight: 500; color: var(--ink-faint); line-height: 1.5; max-width: 280px; }
.map-coord {
  margin-top: 4px;
  font-size: 10.5px;
  font-weight: 700;
  color: #7b8595;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 10px;
  line-height: 1.4;
  max-width: 100%;
}

.store-meta { display: flex; align-items: flex-start; gap: 8px; margin-top: 9px; }
.store-status { flex: 1; min-width: 0; font-size: 11px; line-height: 1.5; color: var(--ink-faint); }
.store-status::before { content: "·"; font-weight: 800; margin-right: 4px; color: #b4bcc7; }
.store-status.on { color: #0d7f4a; }
.store-status.on::before { color: #12b76a; content: "✓"; }
.store-status.error { color: var(--ball-3); }
.store-status.error::before { color: var(--ball-3); content: "!"; }
.store-route { flex: none; font-size: 11px; padding: 5px 9px; text-decoration: none; }
.store-route.is-off { color: #b4bcc7; border-color: var(--line); background: #fafbfd; }

.store-list { display: grid; gap: 7px; margin-top: 10px; }
.store-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.store-item:hover { border-color: #dde5f1; }
.store-item.active { border-color: #c9d8ff; background: #f7faff; }
.store-item-main { min-width: 0; flex: 1; }
.store-item-top { display: flex; align-items: center; gap: 6px; }
.store-item-top b { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-dist {
  flex: none;
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 800;
  color: #2557f5;
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 7px;
}
.store-addr { margin-top: 2px; font-size: 11px; color: var(--ink-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-item-actions { display: flex; gap: 4px; flex: none; }
.store-item-actions .mini-btn { display: inline-flex; align-items: center; font-size: 11px; padding: 5px 8px; text-decoration: none; }
.store-empty { padding: 12px; border-radius: 12px; background: #f7f9fc; font-size: 11.5px; color: var(--ink-faint); text-align: center; line-height: 1.55; }

.kakao-info { padding: 7px 9px; font-size: 12px; line-height: 1.4; max-width: 200px; }
.kakao-info b { display: block; font-weight: 800; color: var(--ink); }
.kakao-info span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-faint); }

/* ---------- 추첨 안내 ---------- */
.info-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.info-list { margin: 0; padding-left: 16px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.info-list li { margin-bottom: 5px; }
.info-list a { color: #2557f5; }

/* ---------- footer ---------- */
.site-footer {
  padding: 6px 4px 10px;
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.38); backdrop-filter: blur(2px); }
.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 24px 24px 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(15, 23, 42, 0.2);
  max-height: 92vh;
  overflow-y: auto;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { font-size: 16.5px; font-weight: 800; }
.modal-hint { font-size: 12px; color: var(--ink-faint); margin-bottom: 12px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.modal .field-label { margin-top: 14px; margin-bottom: 7px; }
.modal .ball-row { margin: 6px 0 4px; }
.modal-backdrop { cursor: pointer; }

.num-grid {
  display: grid;
  /* 1~45 번호를 5개씩 9줄(5×9)로 정확히 배치한다. 남는 줄이 생기지 않는다. */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}
.num-grid .ball {
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 50%;
  position: relative;
  font-size: 14px;
  box-shadow: none;
  border: 1px solid transparent;
  opacity: 0.95;
  cursor: pointer;
}
.num-grid .ball span {
  position: absolute; inset: 0;
  display: grid; place-items: center;
}
.num-grid .ball.off {
  background: #f5f7fa !important;
  color: #b6bfcb;
  box-shadow: none;
  cursor: default;
  text-decoration: none;
}
.num-grid .ball.picked {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #2f5bff;
}

/* ---------- 오늘의 운세 카드 · 모달 ---------- */
.btn-fortune {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #e1eafe;
  background: linear-gradient(100deg, #f0f5ff 0%, #f7faff 70%);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn-fortune:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(47, 91, 255, 0.1); }
.btn-fortune:active { transform: translateY(1px) scale(0.998); }
.fortune-emoji {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: #e8f7ef;
  color: #12b76a;
  display: grid; place-items: center;
  font-size: 17px;
  flex: none;
}
.fortune-label { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.fortune-label b { font-size: 14px; font-weight: 800; color: #1b3e8f; letter-spacing: -0.02em; }
.fortune-label em { font-style: normal; font-size: 11.5px; font-weight: 500; color: #7a8aa5; }
.fortune-chevron { font-size: 18px; color: #9baecb; line-height: 1; flex: none; }

.fortune-sheet { max-width: 460px; }
.fortune-date { font-size: 12px; font-weight: 700; color: var(--ink-faint); margin: -2px 0 10px; }
.fortune-card {
  background: linear-gradient(160deg, #f0f5ff, #fbfdff);
  border: 1px solid #e1eafe;
  border-radius: 16px;
  padding: 14px 16px;
}
.fortune-msg { font-size: 13.5px; line-height: 1.62; color: #223252; }
.fortune-msg strong { display: block; font-size: 15px; font-weight: 800; color: #1b3e8f; margin-bottom: 5px; }
.fortune-meta { display: flex; gap: 7px; margin-top: 12px; flex-wrap: wrap; }
.fm-item {
  flex: 1 1 110px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 8px 10px;
}
.fm-label { font-size: 11px; font-weight: 700; color: var(--ink-faint); }
.fm-item b { font-size: 12.5px; margin-left: auto; }
.fm-swatch { width: 13px; height: 13px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, 0.08); flex: 0 0 auto; background: #eee; }

.fortune-section { margin-top: 16px; }
.fortune-section-title { font-size: 12.5px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.fortune-section-title em { font-style: normal; color: var(--brand); }
.fortune-balls { justify-content: flex-start; margin: 0; }
.fortune-badge {
  margin-top: 8px;
  font-size: 11.5px;
  font-weight: 700;
  color: #0d7f4a;
  background: #eafaf2;
  border-radius: 9px;
  padding: 7px 10px;
  line-height: 1.45;
}

.fortune-seed { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-strong); }
.fortune-seed .field-label { margin-top: 0; }
.fortune-seed-row { display: flex; gap: 7px; align-items: center; }
.fortune-seed-row .input { flex: 1; min-width: 0; }
.fortune-seed-note { margin-top: 7px; font-size: 11px; color: var(--ink-faint); line-height: 1.5; }

.fortune-actions { flex-direction: column; align-items: stretch; gap: 8px; }
.fortune-actions .mini-btn,
.fortune-actions .btn-primary {
  width: 100%;
  padding: 12px 16px;
  font-size: 13.5px;
  border-radius: 12px;
}
.fortune-actions .mini-btn { border-color: #d6e1fb; background: #f6f9ff; color: #2557f5; }
.fortune-disclaimer { margin-top: 10px; font-size: 10.5px; color: var(--ink-faint); text-align: center; line-height: 1.5; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(25, 31, 40, 0.94);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 80;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  max-width: min(90vw, 380px);
  text-align: center;
  line-height: 1.45;
}

/* ---------- 반응형 ---------- */
@media (max-width: 400px) {
  .app { padding: 4px 14px 28px; }
  .card { padding: 16px; border-radius: 20px; }
  .ball { width: 30px; height: 30px; font-size: 12.5px; }
  .ball.lg { width: 34px; height: 34px; font-size: 13.5px; }
  .ball.sm { width: 27px; height: 27px; font-size: 11.5px; }
  .ball-row { gap: 5px; }
  .chip .ball.sm { width: 29px; height: 29px; }
  .g-actions .mini-btn { padding: 6px 9px; }
  .g-balls { gap: 5px; }
  .game-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; }
  .g-label { width: 24px; height: 24px; font-size: 10.5px; }
  .seg { padding: 0 12px; }
  .brand-text h1 { font-size: 16.5px; }
  .latest-head h2 { font-size: 17px; }
  .num-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .num-grid .ball { font-size: 12.5px; }
  .condition-box li { white-space: normal; }
  .store-search .input { font-size: 13px; }
  .store-link { padding: 0 9px; font-size: 11.5px; }
  .map-placeholder { padding: 14px 14px; }
}

@media (min-width: 600px) {
  body {
    background: radial-gradient(900px 520px at 50% 0%, #f2f5fa, #dfe5ee 72%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  .app {
    max-width: 440px;
    margin: 26px 0 40px;
    background: var(--bg);
    border-radius: 34px;
    box-shadow: 0 30px 70px rgba(23, 40, 77, 0.16);
    min-height: 0;
    overflow: hidden;
    padding-top: 4px;
  }
  .modal-sheet { border-radius: 24px; }
  .modal { place-items: center; }
  /* PC 에서는 지도 영역을 380px 로 넓게 */
  .kakao-map { height: 380px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
