:root {
  --ink: #07091b;
  --navy: #0c1030;
  --navy-2: #141947;
  --panel: #101535;
  --panel-soft: #191f48;
  --white: #fffdf8;
  --cream: #fff8e9;
  --gold: #ffc933;
  --gold-2: #ff9d00;
  --red: #ef2447;
  --red-deep: #8e0f2d;
  --blue: #37c9ff;
  --blue-deep: #2d67ef;
  --pink: #ff42b3;
  --mint: #43ebc2;
  --line: rgba(255, 255, 255, .14);
  --muted: #aeb7db;
  --shadow: 0 14px 36px rgba(1, 4, 20, .35);
  --font: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html,
body { height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button,
select,
input { font: inherit; }

button,
select { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(55, 201, 255, .72);
  outline-offset: 2px;
}

button:disabled,
select:disabled { opacity: .46; cursor: not-allowed; }

/* ---------- Service banner ---------- */
.site-banner {
  position: relative;
  z-index: 30;
  flex: 0 0 auto;
  height: clamp(116px, 10vw, 150px);
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 201, 51, .34);
  background: #05081c;
  box-shadow: 0 9px 30px rgba(0, 0, 0, .32);
}

.site-banner-art,
.site-banner-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.site-banner-art img { display: block; object-fit: cover; object-position: center; }

.site-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(7, 12, 47, .05) 0, rgba(4, 6, 24, .12) 48%, rgba(1, 3, 15, .26) 100%);
  pointer-events: none;
}

.site-banner-copy {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 28%;
  text-align: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .84));
}

.site-banner-kicker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #77dcff;
  font-size: clamp(8px, .72vw, 11px);
  font-weight: 950;
  letter-spacing: .16em;
  white-space: nowrap;
}

.site-banner-kicker i { width: 20px; height: 1px; background: linear-gradient(90deg, transparent, #64d7ff); }
.site-banner-kicker i:last-child { background: linear-gradient(90deg, #64d7ff, transparent); }

.site-banner h1 {
  margin: 1px 0 0;
  color: #fff6aa;
  font-size: clamp(30px, 3.2vw, 47px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: -.06em;
  -webkit-text-stroke: 1px #8c2809;
  text-shadow: 0 2px 0 #b31732, 0 4px 0 #5b071d, 0 0 16px rgba(255, 202, 43, .75);
}

.site-banner p {
  margin: 7px 0 0;
  color: #fff;
  font-size: clamp(10px, .95vw, 13px);
  font-weight: 850;
  letter-spacing: -.02em;
}

select {
  min-height: 40px;
  border: 1px solid rgba(122, 137, 207, .34);
  border-radius: 10px;
  background: rgba(4, 7, 26, .83);
  color: #f7f8ff;
}

select {
  min-width: 112px;
  padding: 7px 30px 7px 10px;
  cursor: pointer;
}

input[type="search"] {
  width: 160px;
  min-height: 38px;
  padding: 6px 10px 6px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

input[type="search"]::placeholder { color: #7782ae; }


/* ---------- Clickable stat rail ---------- */
#stats {
  position: relative;
  z-index: 24;
  flex: 0 0 auto;
  min-height: 63px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  overflow-x: auto;
  border-bottom: 1px solid rgba(255, 201, 51, .26);
  background:
    linear-gradient(90deg, rgba(239, 36, 71, .12), transparent 25%),
    #0d112e;
  white-space: nowrap;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}

#stats::-webkit-scrollbar { display: none; }

.chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: 10px;
  background: rgba(255, 255, 255, .065);
  color: #aeb7da;
  font-size: 11px;
  font-weight: 750;
  scroll-snap-align: start;
}

.chip b { color: #fff; font-size: 13px; font-weight: 950; }

button.chip { font-family: inherit; cursor: pointer; }
button.chip:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); }

.chip.rank-chip {
  position: relative;
  min-width: 104px;
  justify-content: center;
  padding: 5px 13px 5px 8px;
  overflow: hidden;
}

.chip.rank-chip img {
  width: 28px;
  height: 35px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5));
}

.chip.rank-chip .chip-copy { display: flex; align-items: center; line-height: 1; }
.chip.rank-chip .chip-copy b { min-width: 2ch; font-size: 18px; font-variant-numeric: tabular-nums; }

.chip.all {
  border-color: rgba(255, 226, 112, .42);
  background: linear-gradient(135deg, rgba(239, 36, 71, .25), rgba(255, 201, 51, .13) 50%, rgba(45, 103, 239, .24));
  color: #ffe27a;
}

.chip.gold {
  border-color: rgba(255, 201, 51, .34);
  background: linear-gradient(135deg, rgba(242, 37, 71, .28), rgba(255, 190, 37, .14));
  color: #ffd976;
}

.chip.blue {
  border-color: rgba(55, 201, 255, .34);
  background: linear-gradient(135deg, rgba(45, 103, 239, .3), rgba(55, 201, 255, .12));
  color: #7fdfff;
}

.chip.rank-chip.active {
  border-color: currentColor;
  box-shadow: inset 0 0 15px rgba(255, 255, 255, .08), 0 0 14px rgba(255, 201, 51, .18);
}

/* ---------- Main map and store list ---------- */
main {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: #dfe5ec;
}

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

#mapLegend {
  position: relative;
  z-index: 24;
  flex: 0 0 auto;
  min-height: 63px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  max-width: none;
  box-sizing: border-box;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid rgba(255, 201, 51, .26);
  border-radius: 0;
  background:
    radial-gradient(circle at 18% 0, rgba(239, 36, 71, .14), transparent 32%),
    radial-gradient(circle at 82% 100%, rgba(45, 103, 239, .12), transparent 34%),
    #0d112e;
  color: #e9edff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

#mapLegend::-webkit-scrollbar { display: none; }

#mapLegend button {
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 7px 4px 5px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  color: #c6cce2;
  font-size: 9.5px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  opacity: .68;
  transition: opacity .16s, border-color .16s, background .16s, transform .16s;
  touch-action: manipulation;
}

#mapLegend button:hover { opacity: 1; transform: translateY(-1px); }
#mapLegend button.active { opacity: 1; color: #fff; }
#mapLegend button.rank-1.active { border-color: #ffd75a; background: linear-gradient(180deg, rgba(154, 91, 0, .92), rgba(78, 30, 7, .96)); box-shadow: 0 0 12px rgba(255, 190, 34, .28); }
#mapLegend button.rank-2.active { border-color: #79d6ff; background: linear-gradient(180deg, rgba(12, 105, 169, .92), rgba(7, 42, 93, .96)); box-shadow: 0 0 12px rgba(50, 181, 255, .24); }
#mapLegend .legend-all { padding: 4px 9px 4px 5px; border-color: rgba(255, 213, 90, .52); color: #ffe584; opacity: 1; }
#mapLegend .legend-all.active { border-color: #fff0a4; background: linear-gradient(180deg, #ffe783, #ffb617); color: #211207; box-shadow: 0 0 14px rgba(255, 190, 34, .35), inset 0 1px 0 #fff; }
#mapLegend .legend-all:hover { background: linear-gradient(180deg, #ffe783, #ffb617); color: #211207; }
#mapLegend .legend-all b { min-width: 2ch; font-size: 13px; font-weight: 950; font-variant-numeric: tabular-nums; }
#mapLegend img { width: 20px; height: 26px; object-fit: contain; }

/* ---------- Selected round winning numbers ---------- */
.winning-numbers {
  position: relative;
  z-index: 23;
  flex: 0 0 auto;
  min-height: 56px;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 7px 16px;
  box-sizing: border-box;
  overflow: hidden;
  border-bottom: 1px solid rgba(55, 201, 255, .22);
  background:
    radial-gradient(circle at 24% 0, rgba(255, 198, 40, .12), transparent 32%),
    radial-gradient(circle at 76% 100%, rgba(55, 201, 255, .12), transparent 34%),
    linear-gradient(180deg, #10163b, #090d28);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05);
}

.winning-numbers[hidden] { display: none; }

.winning-result-copy {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
}

.winning-result-copy small {
  grid-column: 1 / -1;
  color: #ffdb5d;
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .14em;
}

.winning-result-copy strong {
  font-size: 14px;
  font-weight: 950;
  line-height: 1.2;
  white-space: nowrap;
}

.winning-result-copy time {
  color: #9ca8cd;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.winning-ball-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lotto-ball {
  width: 31px;
  height: 31px;
  display: inline-flex;
  flex: 0 0 31px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .58);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .65);
  box-shadow: inset 0 2px 2px rgba(255, 255, 255, .42), inset 0 -4px 6px rgba(0, 0, 0, .2), 0 2px 5px rgba(0, 0, 0, .34);
}

.ball-yellow { background: linear-gradient(145deg, #ffd950, #e89d00); color: #241604; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.ball-blue { background: linear-gradient(145deg, #55c7ff, #1475d1); }
.ball-red { background: linear-gradient(145deg, #ff7380, #d92e42); }
.ball-gray { background: linear-gradient(145deg, #b7bfca, #66717e); }
.ball-green { background: linear-gradient(145deg, #65d58b, #159651); }

.winning-plus {
  margin: 0 1px;
  color: #7782aa;
  font-size: 17px;
  font-weight: 950;
}

.winning-bonus {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.winning-bonus small {
  color: #aab4d8;
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.map-scope-wrap { display: block; flex: 0 0 auto; }

#mapScopeSel {
  width: 124px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 24px 6px 10px;
  border-color: rgba(255, 213, 90, .48);
  border-radius: 9px;
  background-color: rgba(44, 30, 8, .92);
  color: #ffe584;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 950;
}

#btnMapSearch {
  position: absolute;
  z-index: 13;
  top: 14px;
  right: auto;
  left: 364px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .88);
  border-radius: 13px;
  background: linear-gradient(180deg, #2698ff, #1252c5);
  color: #fff;
  box-shadow: 0 7px 22px rgba(5, 30, 94, .38), inset 0 1px 0 rgba(255, 255, 255, .4);
  cursor: pointer;
  touch-action: manipulation;
}

#btnMapSearch:hover { transform: translateY(-1px); filter: brightness(1.08); }

.mobile-search-sheet {
  position: fixed;
  z-index: 75;
  inset: 0;
}

.mobile-search-sheet[hidden] { display: none; }

.mobile-sheet-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(2, 4, 18, .66);
  opacity: 0;
  cursor: default;
  transition: opacity .24s ease;
  backdrop-filter: blur(3px);
}

.mobile-sheet-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  max-height: min(76vh, 610px);
  padding: 0 16px calc(16px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 1px solid rgba(255, 213, 90, .34);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background:
    radial-gradient(circle at 10% 0, rgba(239, 36, 71, .19), transparent 31%),
    linear-gradient(180deg, #171c46, #090c27);
  box-shadow: 0 -18px 55px rgba(0, 0, 0, .54), inset 0 1px 0 rgba(255, 255, 255, .1);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.22, .8, .32, 1);
}

.mobile-search-sheet.open .mobile-sheet-backdrop { opacity: 1; }
.mobile-search-sheet.open .mobile-sheet-panel { transform: translateY(0); }

.mobile-sheet-drag {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.mobile-sheet-drag i { width: 46px; height: 5px; border-radius: 999px; background: rgba(207, 216, 246, .45); }

.mobile-sheet-head { display: flex; align-items: center; gap: 10px; padding: 0 1px 14px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.mobile-sheet-head > div { display: flex; flex-direction: column; }
.mobile-sheet-head small { color: var(--gold); font-size: 8px; font-weight: 950; letter-spacing: .18em; }
.mobile-sheet-head strong { color: #fff; font-size: 18px; font-weight: 950; letter-spacing: -.03em; }
.mobile-sheet-head button { width: 38px; height: 38px; margin-left: auto; border: 1px solid rgba(255, 255, 255, .14); border-radius: 11px; background: rgba(255, 255, 255, .07); color: #c8d0ec; font-size: 15px; cursor: pointer; }

.mobile-sheet-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; padding: 16px 0 14px; }
.mobile-sheet-fields > label { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mobile-sheet-fields > label > span { padding-left: 3px; color: #aeb8da; font-size: 11px; font-weight: 900; }
.mobile-sheet-fields select,
.mobile-store-search > div {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(139, 154, 218, .3);
  border-radius: 12px;
  background: rgba(3, 6, 25, .72);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  box-shadow: inset 0 1px 8px rgba(0, 0, 0, .25);
}

.mobile-sheet-fields select { padding: 9px 34px 9px 12px; }
.mobile-store-search { grid-column: 1 / -1; }
.mobile-store-search > div { display: flex; align-items: center; padding: 0 12px; }
.mobile-store-search svg,
#btnMapSearch svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.mobile-store-search svg { flex: 0 0 auto; color: #6fcfff; }
.mobile-store-search input { min-width: 0; flex: 1; min-height: 46px; padding: 8px 9px; border: 0; outline: 0; background: transparent; color: #fff; font-size: 16px; font-weight: 750; }
.mobile-store-search input::placeholder { color: #7783aa; }

.mobile-search-submit {
  width: 100%;
  min-height: 50px;
  border: 1px solid #ffe27b;
  border-radius: 13px;
  background: linear-gradient(180deg, #ff3e61, #b50d31);
  color: #fff;
  font-size: 15px;
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(115, 3, 31, .34), inset 0 1px 0 rgba(255, 255, 255, .4);
  cursor: pointer;
}

.neighborhood-radius {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.neighborhood-radius legend {
  width: 100%;
  margin-bottom: 7px;
  color: #d7ddf4;
  font-size: 11px;
  font-weight: 900;
}

.neighborhood-radius input { position: absolute; opacity: 0; pointer-events: none; }

.neighborhood-radius span {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 154, 218, .32);
  border-radius: 11px;
  background: rgba(3, 6, 25, .72);
  color: #b7c0df;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: border-color .16s, background .16s, color .16s, transform .16s;
}

.neighborhood-radius input:checked + span {
  border-color: #ffe27b;
  background: linear-gradient(180deg, #ff3e61, #b50d31);
  color: #fff;
  box-shadow: 0 6px 16px rgba(115, 3, 31, .32), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.neighborhood-radius input:focus-visible + span { outline: 2px solid #72dfff; outline-offset: 2px; }
.neighborhood-submit:disabled { cursor: wait; opacity: .7; }

@media (min-width: 821px) {
  .mobile-sheet-panel {
    right: auto;
    bottom: 22px;
    left: 50%;
    width: min(640px, calc(100vw - 48px));
    padding: 18px 20px 20px;
    border-bottom: 1px solid rgba(255, 213, 90, .34);
    border-radius: 22px;
    height: auto;
    max-height: min(76vh, 610px);
    transform: translate(-50%, calc(100% + 46px));
  }

  .mobile-search-sheet.open .mobile-sheet-panel { transform: translate(-50%, 0); }
  .mobile-sheet-drag { display: none; }
}

.location-consent-popup {
  position: fixed;
  z-index: 78;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 4, 18, .76);
  backdrop-filter: blur(7px);
}

.location-consent-popup[hidden] { display: none; }

.location-consent-card {
  position: relative;
  width: min(390px, 92vw);
  padding: 25px 22px 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 218, 100, .7);
  border-radius: 21px;
  background:
    radial-gradient(circle at 10% 0, rgba(239, 36, 71, .23), transparent 34%),
    linear-gradient(145deg, #171c48, #090c29);
  color: #fff;
  text-align: center;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .66), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: consent-card-in .25s ease-out;
}

.location-consent-card::after { content: ""; position: absolute; right: 0; bottom: 0; left: 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--gold), var(--blue)); }
.location-consent-close { position: absolute; top: 10px; right: 10px; width: 34px; height: 34px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 10px; background: rgba(255, 255, 255, .06); color: #9ba5c8; cursor: pointer; }
.location-consent-icon { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 9px; border: 1px solid rgba(104, 207, 255, .44); border-radius: 50%; background: radial-gradient(circle, rgba(38, 152, 255, .35), rgba(18, 82, 197, .1)); color: #7ad8ff; box-shadow: 0 0 22px rgba(38, 152, 255, .2); }
.location-consent-icon .location-target { width: 28px; height: 28px; }
.location-consent-icon .location-target::before { inset: 7px; }
.location-consent-icon .location-target::after { top: -7px; left: 11px; height: 38px; background: linear-gradient(currentColor 0 5px, transparent 5px 33px, currentColor 33px); }
.location-consent-card > small { display: block; color: var(--gold); font-size: 8px; font-weight: 950; letter-spacing: .2em; }
.location-consent-card > strong { display: block; margin: 3px 20px 8px; font-size: 20px; font-weight: 950; letter-spacing: -.04em; }
.location-consent-card > p { margin: 0; color: #aeb8da; font-size: 12px; line-height: 1.65; }
.location-consent-card > p b { color: #ffe27a; }
.location-consent-error { margin-top: 9px !important; padding: 7px 9px; border: 1px solid rgba(255, 74, 106, .28); border-radius: 8px; background: rgba(239, 36, 71, .11); color: #ff9caf !important; }
.location-consent-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 17px; }
.location-consent-actions button { min-height: 46px; border-radius: 11px; font-size: 13px; font-weight: 950; cursor: pointer; }
#btnConsentConfirm { border: 1px solid #ffe27b; background: linear-gradient(180deg, #ff3e61, #b50d31); color: #fff; box-shadow: 0 7px 18px rgba(115, 3, 31, .34), inset 0 1px 0 rgba(255, 255, 255, .38); }

@keyframes consent-card-in {
  from { transform: translateY(14px) scale(.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

#btnMyLocation {
  position: absolute;
  z-index: 13;
  right: 14px;
  bottom: 86px;
  width: 132px;
  height: 50px;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px 0 48px;
  border: 0;
  border-radius: 0;
  background: url("/assets/my-location-button-v1.webp") center / 100% 100% no-repeat;
  color: #fff;
  font-size: 13px;
  font-weight: 950;
  text-shadow: 0 1px 2px #03194f, 0 0 5px rgba(80, 222, 255, .9);
  filter: drop-shadow(0 7px 12px rgba(5, 30, 94, .46));
  cursor: pointer;
  touch-action: manipulation;
}

#btnMyLocation:hover { transform: translateY(-1px); filter: brightness(1.08) drop-shadow(0 8px 13px rgba(5, 30, 94, .52)); }
#btnMyLocation:disabled { cursor: wait; transform: none; opacity: .72; }

#btnNeighborhood {
  position: absolute;
  z-index: 13;
  right: 14px;
  bottom: 30px;
  left: auto;
  width: 132px;
  height: 50px;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px 0 47px;
  border: 0;
  border-radius: 0;
  background: url("/assets/neighborhood-button-v1.webp") center / 100% 100% no-repeat;
  color: #fff7d2;
  font-size: 13px;
  font-weight: 950;
  text-shadow: 0 1px 2px #5b0700, 0 0 5px rgba(255, 208, 54, .9);
  filter: drop-shadow(0 7px 12px rgba(112, 20, 0, .46));
  cursor: pointer;
  touch-action: manipulation;
}

#btnNeighborhood:hover { transform: translateY(-1px); filter: brightness(1.07) drop-shadow(0 8px 13px rgba(112, 20, 0, .52)); }
#btnNeighborhood:disabled { cursor: wait; transform: none; opacity: .72; }
#btnMyLocation > .location-target,
#btnNeighborhood > .neighborhood-star { display: none; }
#btnMyLocation b,
#btnNeighborhood b { position: relative; z-index: 1; line-height: 1; white-space: nowrap; }

.location-target {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.location-target::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}

.location-target::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 6px;
  width: 2px;
  height: 24px;
  border-radius: 2px;
  background: linear-gradient(currentColor 0 3px, transparent 3px 21px, currentColor 21px);
}

.my-location-dot {
  position: relative;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1688ff;
  box-shadow: 0 2px 8px rgba(0, 46, 128, .52);
}

.my-location-dot::after {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(22, 136, 255, .42);
  border-radius: 50%;
  animation: location-pulse 1.6s ease-out infinite;
}

@keyframes location-pulse {
  from { transform: scale(.45); opacity: 1; }
  to { transform: scale(1.35); opacity: 0; }
}

#panel {
  order: -1;
  width: 350px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 201, 51, .22);
  background: linear-gradient(180deg, #12173b, #090c26);
  box-shadow: 10px 0 30px rgba(1, 3, 18, .2);
}

.panel-backdrop { display: none; }

.ph {
  min-height: 63px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(239, 36, 71, .16), transparent);
}

.ph > div { display: flex; flex-direction: column; }
.ph small { color: var(--gold); font-size: 8px; font-weight: 900; letter-spacing: .18em; }
.ph #phTitle { color: #fff; font-size: 15px; font-weight: 900; }
.ph #phClose { display: none; margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; }

#list { flex: 1; overflow-y: auto; scrollbar-color: rgba(255, 201, 51, .35) transparent; }

.item {
  position: relative;
  padding: 12px 14px 12px 49px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
  cursor: pointer;
  transition: background .16s, transform .16s;
}

.item.has-distance { padding-right: 88px; }

.item-distance {
  position: absolute;
  top: 50%;
  right: 13px;
  min-width: 60px;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 3px;
  padding: 6px 8px;
  border: 1px solid rgba(94, 218, 255, .3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(26, 105, 164, .34), rgba(11, 43, 91, .5));
  color: #b9efff;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 4px 12px rgba(0, 0, 0, .18);
}

.item-distance strong {
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.item-distance small {
  color: #72dfff;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .08em;
}

.item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 13px;
  width: 26px;
  height: 34px;
  background: var(--rank-icon) center / contain no-repeat;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .45));
}

.item.rank-1 { --rank-icon: url('/assets/rank-1-marker-v3.webp'); }
.item.rank-2 { --rank-icon: url('/assets/rank-2-marker-v3.webp'); }

.item:hover { background: rgba(255, 255, 255, .07); transform: translateX(-2px); }
.item .l1 { display: flex; align-items: center; gap: 6px; }
.item .nm { overflow: hidden; color: #fff; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.item .ad { margin-top: 3px; color: #929cc3; font-size: 11px; line-height: 1.4; }
.item .l3 { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }

.tag {
  padding: 2px 7px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #aeb7d8;
  font-size: 10px;
}

.tag.r1 { border-color: rgba(255, 201, 51, .24); background: rgba(239, 36, 71, .17); color: #ffd56a; font-weight: 850; }
.tag.r2 { border-color: rgba(55, 201, 255, .22); background: rgba(45, 103, 239, .19); color: #7addff; font-weight: 850; }
.tag.total { border-color: rgba(194, 118, 255, .25); background: rgba(132, 58, 190, .17); color: #ddb0ff; font-weight: 900; }
.tag.auto { background: rgba(67, 235, 194, .12); color: #72f4d3; }
.tag.hand { background: rgba(255, 66, 179, .12); color: #ff82cb; }
.tag.link { color: #7fdfff; text-decoration: none; }
.tag.link:hover { border-color: var(--blue); }

.empty { padding: 30px 16px; color: #8994bd; font-size: 12px; line-height: 1.7; text-align: center; }

#btnList {
  display: none;
  position: fixed;
  z-index: 35;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 11px 19px;
  border: 1px solid #ffe07c;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff3d5f, #b30d31);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 6px 22px rgba(115, 3, 31, .5), inset 0 1px 0 rgba(255, 255, 255, .45);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
}

#btnList.is-panel-open,
.mobile-search-sheet:not([hidden]) ~ #btnList {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
}

/* ---------- Kakao info window ---------- */
.iw {
  width: 322px;
  max-width: 86vw;
  box-sizing: border-box;
  overflow: hidden;
  border: 1px solid #dfe4f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(7, 12, 42, .24);
  overflow-wrap: anywhere;
  color: #171932;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  word-break: keep-all;
}

.iw .iw-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 36px 11px 13px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 201, 51, .24), transparent 30%),
    linear-gradient(135deg, #141943, #080b24);
}

.iw .iw-head.rank-2 {
  background:
    radial-gradient(circle at 14% 20%, rgba(55, 201, 255, .26), transparent 30%),
    linear-gradient(135deg, #13285e, #080b24);
}

.iw .iw-medal {
  width: 44px;
  height: 52px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.iw .iw-medal img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .48)); }
.iw .iw-headcopy { min-width: 0; }
.iw .iw-kicker { display: block; margin-bottom: 2px; color: #ffd967; font-size: 8px; font-weight: 950; letter-spacing: .16em; }
.iw .rank-2 .iw-kicker { color: #77ddff; }
.iw .nm { overflow: hidden; color: #fff; font-size: 17px; font-weight: 950; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.iw .iw-body { padding: 13px 14px 11px; }
.iw .iw-address { display: flex; align-items: flex-start; gap: 7px; color: #4e5876; font-size: 12.5px; line-height: 1.5; }
.iw .iw-address span { flex: 0 0 auto; color: #e52049; font-size: 16px; line-height: 1.2; }
.iw .iw-address b { font-weight: 700; }
.iw .rows { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.iw .tag { padding: 4px 9px; border-color: #dce1ef; background: #f0f3fa; font-size: 11.5px; }
.iw .tag.r1 { border-color: #f3d288; background: #fff2d3; color: #9b5400; }
.iw .tag.r2 { border-color: #b9dcf4; background: #e8f6ff; color: #175f92; }
.iw .iw-section-title { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; padding-top: 9px; border-top: 1px solid #e9edf5; }
.iw .iw-section-title span { color: #222844; font-size: 11.5px; font-weight: 900; }
.iw .iw-section-title em { color: #7c86a2; font-size: 10.5px; font-style: normal; }
.iw .hist { display: flex; flex-wrap: wrap; gap: 5px; max-height: 104px; margin: 0; overflow-y: auto; }
.iw .hist.expanded { max-height: min(220px, 32vh); padding-right: 2px; }
.iw .hrow { display: inline-flex; align-items: center; gap: 4px; padding: 4px 7px; border: 1px solid #e5e9f2; border-radius: 7px; background: #f5f7fb; color: #59627c; font-size: 11px; white-space: nowrap; }
.iw .hrow b { font-weight: 950; }
.iw .hrow strong { color: #252b47; font-weight: 850; }
.iw .hrow b.r1 { color: #c87000; }
.iw .hrow b.r2 { color: #176bb0; }
.iw .hrow i { opacity: .7; font-style: normal; }
.iw .iw-more { width: 100%; min-height: 34px; margin-top: 7px; border: 1px dashed #9baad0; border-radius: 8px; background: #f8faff; color: #40588e; font-size: 11.5px; font-weight: 850; cursor: pointer; }
.iw .iw-more b { color: #d51642; }
.iw .iw-more:hover { border-color: #536fab; background: #edf3ff; }
.iw .iw-phone { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: #59627c; font-size: 12px; font-weight: 750; }
.iw .iw-phone span { color: #1f66c2; }
.iw .iw-actions { display: flex; padding: 10px 12px 12px; border-top: 1px solid #e6eaf3; background: #f7f9fd; }
.iw .iw-action {
  flex: 1;
  min-height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid #cfd7e8;
  border-radius: 9px;
  background: #fff;
  color: #263b70;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 2px 5px rgba(17, 30, 75, .06);
}
.iw .iw-action span { font-size: 16px; line-height: 1; }
.iw .iw-action:hover { border-color: #6885ca; background: #f2f6ff; }
.iw .iw-action.primary { border-color: #dd1640; background: linear-gradient(180deg, #ff3e61, #b80d31); color: #fff; box-shadow: 0 4px 10px rgba(184, 13, 49, .2); }
.iw .iw-loading-row { display: flex; align-items: center; gap: 9px; padding: 15px; color: #6f7893; font-size: 12px; }
.iw .iw-loading-row i { width: 14px; height: 14px; border: 2px solid #d8dfed; border-top-color: #e91e48; border-radius: 50%; animation: iw-spin .7s linear infinite; }

@keyframes iw-spin { to { transform: rotate(360deg); } }

/* ---------- 앱 설치 중앙 팝업 ---------- */
.install-banner {
  position: fixed;
  z-index: 79;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  padding: 20px;
  overflow-y: auto;
  background: rgba(2, 4, 18, .76);
  backdrop-filter: blur(7px);
}

.install-banner[hidden] { display: none; }

.install-card {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 44px 18px 18px;
  overflow-y: auto;
  border: 1px solid rgba(255, 214, 90, .72);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% 18%, rgba(255, 201, 51, .18), transparent 34%),
    linear-gradient(135deg, rgba(18, 23, 61, .98), rgba(7, 10, 32, .98));
  color: #fff;
  box-shadow: 0 24px 80px rgba(1, 3, 18, .68), inset 0 1px 0 rgba(255, 255, 255, .13);
  animation: install-card-in .24s ease-out;
}

.install-card::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: linear-gradient(90deg, var(--red), var(--gold), var(--blue)); }
.install-banner.guide-open .install-card { align-items: flex-start; }
.install-icon { width: 72px; height: 72px; flex: 0 0 auto; border-radius: 18px; box-shadow: 0 0 22px rgba(255, 201, 51, .28); }
.install-copy { min-width: 0; flex: 1; }
.install-kicker { display: block; color: var(--gold); font-size: 8px; font-weight: 950; letter-spacing: .17em; }
.install-copy strong { display: block; margin-top: 2px; color: #fff; font-size: 17px; font-weight: 950; }
.install-copy p { margin: 4px 0 12px; color: #aeb8da; font-size: 12px; line-height: 1.5; }
.install-actions { display: grid; grid-template-columns: 1.25fr 1fr; gap: 8px; }
.install-actions button { min-height: 40px; padding: 7px 12px; border-radius: 10px; font-size: 12px; font-weight: 900; cursor: pointer; }
#btnInstallApp { border: 1px solid #ffd968; background: linear-gradient(180deg, #ff3d60, #b30d31); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3); }
#btnInstallLater { border: 1px solid rgba(255, 255, 255, .17); background: rgba(255, 255, 255, .07); color: #c8d0ec; }
.install-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 9px; background: rgba(255, 255, 255, .05); color: #9da8cd; font-size: 13px; cursor: pointer; }
.install-guide { margin-top: 8px; padding: 7px 9px; border: 1px solid rgba(55, 201, 255, .25); border-radius: 8px; background: rgba(45, 103, 239, .12); color: #b9eaff; font-size: 10.5px; line-height: 1.5; }

@keyframes install-card-in {
  from { transform: translateY(14px) scale(.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ---------- Modal, ranking and detail ---------- */
#modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 4, 18, .74);
  backdrop-filter: blur(7px);
}

#modal[hidden] { display: none; }

.rm-box {
  width: min(660px, 94vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 201, 51, .34);
  border-radius: 18px;
  background: linear-gradient(180deg, #171c46, #0c102d);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .62), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.rm-head { display: flex; align-items: center; gap: 10px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(239, 36, 71, .18), transparent); }
.rm-head b { color: #fff; font-size: 16px; }
.rm-sub { color: var(--muted); font-size: 11px; }
.rm-head button { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 17px; cursor: pointer; }
#mBody { overflow-y: auto; }

.rrow { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid rgba(255, 255, 255, .075); cursor: pointer; }
.rrow:hover { background: rgba(255, 255, 255, .06); }
.rrow .no { width: 28px; color: #7d87ae; font-weight: 900; text-align: center; }
.rrow .no.top { color: var(--gold); font-size: 17px; }
.rrow .mid { flex: 1; min-width: 0; }
.rrow .nm { overflow: hidden; color: #fff; font-size: 13px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.rrow .ad { overflow: hidden; color: #8d97bd; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.rrow .mid .l3 { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.rrow .side { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.rrow .cnt { color: var(--gold); font-size: 17px; font-weight: 950; white-space: nowrap; }
.rrow .cnt span { color: #9da6ca; font-size: 10px; font-weight: 500; }

.sd-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.btn-go { margin-left: auto; padding: 7px 14px; border-radius: 8px; background: linear-gradient(180deg, #ff3c5d, #b10c30); color: #fff; font-size: 12px; font-weight: 850; text-decoration: none; }
.btn-go.ghost { margin-left: 0; border: 1px solid rgba(55, 201, 255, .35); background: rgba(45, 103, 239, .14); color: #9de7ff; }
.sd-h { padding: 12px 16px 7px; color: #9ea8ce; font-size: 11px; font-weight: 850; }
.wrow { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid rgba(255, 255, 255, .055); color: #d9def2; font-size: 12px; }
.wrow .wr { width: 38px; font-weight: 900; }
.wrow .wr.r1 { color: var(--gold); }
.wrow .wr.r2 { color: var(--blue); }
.wrow .wround { width: 62px; font-weight: 700; }
.wrow .wdate { width: 96px; color: #939dc3; }
.wrow .wtype { color: #939dc3; }

/* ---------- Loading / map fallback / notice ---------- */
#overlay {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 32%, rgba(239, 36, 71, .26), transparent 30%),
    linear-gradient(145deg, #151a49, #050717 65%);
}

#overlay.hide { display: none; }
.ov-box { width: min(440px, 88vw); text-align: center; }
.ov-emblem { width: 76px; height: 92px; object-fit: contain; filter: drop-shadow(0 0 14px rgba(255, 201, 51, .58)); }
.ov-kicker { color: var(--gold); font-size: 9px; font-weight: 900; letter-spacing: .22em; }
.ov-title { margin: 1px 0 15px; color: #fff; font-size: 24px; font-weight: 950; }
.ov-bar { height: 8px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); border-radius: 999px; background: rgba(255, 255, 255, .07); }
.ov-bar i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--red), var(--gold), var(--blue)); box-shadow: 0 0 12px var(--gold); transition: width .3s; }
.ov-msg { margin-top: 10px; color: #ccd3ee; font-size: 12px; }
.ov-hint { margin-top: 15px; color: #7f8ab2; font-size: 11px; line-height: 1.7; }

#mapless { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(circle, #19204d, #090c26); text-align: center; }
#mapless[hidden] { display: none; }
.ml-icon { margin-bottom: 10px; font-size: 38px; }
.ml-title { margin-bottom: 6px; color: #fff; font-weight: 900; }
.ml-sub { color: #9ba5ca; font-size: 12px; line-height: 1.8; }
.ml-sub code { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255, 255, 255, .07); color: #fff; }
.ml-err { display: inline-block; margin-bottom: 10px; padding: 7px 12px; border-radius: 8px; background: rgba(239, 36, 71, .17); color: #ff9faf; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }

#notice { flex: 0 0 auto; padding: 8px 14px; border-bottom: 1px solid rgba(255, 201, 51, .3); background: #3a2405; color: #ffdf7e; font-size: 11px; }
#notice[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1120px) {
  #panel { width: 320px; }
  #btnMyLocation { right: 14px; }
  #btnNeighborhood { right: 14px; left: auto; }
  #btnMapSearch { right: auto; left: 334px; }
}

@media (max-width: 820px) {
  .site-banner { height: clamp(38px, 9.6vw, 45px); }
  .site-banner-copy { padding: 1px 22%; }
  .site-banner-kicker { gap: 3px; font-size: 5px; line-height: 1; letter-spacing: .08em; }
  .site-banner-kicker i { width: 7px; }
  .site-banner h1 {
    margin-top: 1px;
    font-size: clamp(18px, 5.3vw, 22px);
    line-height: .94;
    -webkit-text-stroke-width: .5px;
    text-shadow: 0 1px 0 #b31732, 0 2px 0 #5b071d, 0 0 8px rgba(255, 202, 43, .68);
  }
  .site-banner p { margin-top: 2px; font-size: 6px; line-height: 1; white-space: nowrap; }

  #stats {
    min-height: 62px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    display: grid;
    gap: 6px;
    padding: 7px 8px 8px;
    overflow: hidden;
    border-bottom-color: rgba(255, 201, 51, .34);
    background:
      radial-gradient(circle at 12% 0, rgba(239, 36, 71, .2), transparent 34%),
      radial-gradient(circle at 78% 100%, rgba(45, 103, 239, .18), transparent 36%),
      linear-gradient(180deg, #151a45, #090c29);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 7px 18px rgba(2, 4, 20, .28);
  }
  .chip {
    min-height: 36px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .055);
  }
  .chip.rank-chip {
    width: 100%;
    min-width: 0;
    min-height: 47px;
    padding: 4px 8px;
    border-radius: 12px;
  }
  .chip.rank-chip img { width: 30px; height: 38px; }
  .chip.rank-chip .chip-copy b { font-size: 17px; }

  #panel {
    position: absolute;
    z-index: 26;
    left: 0;
    right: 0;
    top: 8px;
    bottom: 0;
    width: auto;
    height: calc(100% - 8px);
    max-height: none;
    border-top: 1px solid rgba(255, 201, 51, .32);
    border-left: 0;
    border-right: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 38px rgba(0, 0, 0, .45);
    transform: translateY(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform .24s ease, visibility 0s linear .24s;
    will-change: transform;
  }

  #panel.open {
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: transform .24s ease;
  }
  #panel.dragging { transition: none; }
  .panel-backdrop {
    position: absolute;
    z-index: 25;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(2, 4, 18, .38);
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s ease;
    backdrop-filter: blur(1.5px);
  }
  .panel-backdrop[hidden] { display: none; }
  .panel-backdrop.open { opacity: 1; pointer-events: auto; }
  #panel .ph {
    position: relative;
    padding-top: 24px;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  #panel.dragging .ph { cursor: grabbing; }
  #panel .ph::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(214, 222, 249, .48);
    transform: translateX(-50%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .12);
  }
  .ph #phClose { display: block; }
  #btnList {
    display: block;
    right: auto;
    bottom: 34px;
    left: 10px;
    padding: 10px 15px;
    transform: none;
  }
  #btnList.is-panel-open,
  .mobile-search-sheet:not([hidden]) ~ #btnList { transform: translateY(18px); }
  #mapLegend {
    min-height: 54px;
    grid-template-columns:
      minmax(100px, 1.2fr)
      minmax(42px, .5fr)
      minmax(74px, 1fr)
      minmax(74px, 1fr);
    display: grid;
    width: 100%;
    max-width: none;
    justify-content: start;
    gap: 4px;
    padding: 5px 8px;
    overflow-x: hidden;
    border-radius: 0;
  }
  #mapLegend > * { width: 100%; min-width: 0; }
  #mapLegend > .map-scope-wrap { grid-column: 1; }
  #mapLegend > .legend-all { grid-column: 2; padding-right: 4px; padding-left: 4px; }
  #mapLegend > .rank-1 { grid-column: 3; }
  #mapLegend > .rank-2 { grid-column: 4; }
  #mapScopeSel {
    width: 100%;
    min-height: 40px;
    padding: 5px 18px 5px 8px;
    border: 1px solid rgba(255, 213, 90, .48);
    border-radius: 9px;
    background-color: rgba(44, 30, 8, .92);
    color: #ffe584;
    font-size: 12px;
    font-weight: 950;
  }
  #mapLegend button { min-height: 38px; }
  #mapLegend button.rank-1,
  #mapLegend button.rank-2 { font-size: 10.5px; }
  .winning-numbers { min-height: 48px; gap: 8px; padding: 5px 8px; }
  .winning-result-copy { column-gap: 4px; }
  .winning-result-copy small { display: none; }
  .winning-result-copy strong { font-size: 11px; }
  .winning-result-copy time { font-size: 7.5px; }
  .winning-ball-row { gap: 4px; }
  .lotto-ball { width: 26px; height: 26px; flex-basis: 26px; font-size: 10px; }
  .winning-plus { margin: 0; font-size: 14px; }
  .winning-bonus { gap: 3px; }
  .winning-bonus small { font-size: 7px; }
  #btnMapSearch {
    top: 10px;
    right: auto;
    left: 10px;
    width: 44px;
    height: 44px;
  }
  #btnMyLocation { position: fixed; right: 10px; bottom: 88px; width: 124px; height: 46px; min-height: 46px; padding: 0 11px 0 45px; }
  #btnNeighborhood { position: fixed; right: 10px; bottom: 34px; left: auto; width: 124px; height: 46px; min-height: 46px; padding: 0 9px 0 44px; }
  .mobile-sheet-panel { height: calc(100dvh - 92px); max-height: calc(100dvh - 92px); }

  .install-banner {
    inset: 0;
    width: auto;
    min-width: 0;
    padding: 14px;
  }
  .install-card { width: min(400px, 100%); padding: 16px 42px 16px 16px; gap: 11px; }
  .install-icon { width: 58px; height: 58px; border-radius: 14px; }
  .install-copy strong { font-size: 14px; }
  .install-copy p { margin-bottom: 7px; font-size: 10.5px; }
  .install-actions button { min-height: 38px; }
}

@media (max-width: 520px) {
  .site-banner-copy { padding-right: 21%; padding-left: 21%; }
  #mapLegend button { min-height: 35px; padding: 3px 6px 3px 4px; font-size: 8.5px; }
  #mapLegend .legend-all { padding: 3px 4px; }
  #mapLegend img { width: 18px; height: 23px; }
  #mapScopeSel { width: 100%; min-height: 38px; padding: 4px 16px 4px 7px; font-size: 11.5px; }
  .winning-numbers { min-height: 44px; gap: 5px; padding: 4px 6px; }
  .winning-result-copy { display: block; }
  .winning-result-copy strong { display: block; font-size: 10px; }
  .winning-result-copy time { display: block; margin-top: 2px; font-size: 6.5px; }
  .winning-ball-row { gap: 3px; }
  .lotto-ball { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }
  .winning-plus { font-size: 12px; }
  .winning-bonus small { display: none; }
  #btnMapSearch { width: 42px; height: 42px; }
  .mobile-sheet-panel { padding-right: 13px; padding-left: 13px; }
  .mobile-sheet-fields { gap: 9px; }
  .rm-head { align-items: flex-start; }
  .rm-sub { max-width: 48vw; }
  .sd-top .btn-go { margin-left: 0; }
  .iw { width: 310px; max-width: 90vw; }
  .iw .iw-action { font-size: 13.5px; }
}

@media (max-width: 360px) {
  .site-banner-copy { padding-right: 20%; padding-left: 20%; }
  .site-banner-kicker { font-size: 4.5px; }
  .site-banner h1 { font-size: 18px; }
  .site-banner p { font-size: 5.5px; }
  #mapLegend button.rank-1,
  #mapLegend button.rank-2 { gap: 1px; padding-right: 2px; padding-left: 2px; }
  #mapLegend button.rank-1 img,
  #mapLegend button.rank-2 img { width: 15px; height: 20px; }
  .winning-numbers { gap: 3px; padding-right: 4px; padding-left: 4px; }
  .winning-result-copy time { display: none; }
  .winning-ball-row { gap: 2px; }
  .lotto-ball { width: 22px; height: 22px; flex-basis: 22px; font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
