:root {
  --bg: hsl(38, 40%, 92%);
  --ink: hsl(20, 15%, 12%);
  --muted: hsl(20, 10%, 40%);
  --faint: hsl(20, 10%, 55%);
  --accent: hsl(28, 55%, 35%);
  --card: hsl(36, 35%, 87%);
  --line: hsl(30, 20%, 72%);
  --pin: rgb(201, 106, 61);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: Raleway, system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2 { font-family: Cinzel, Georgia, serif; font-weight: 600; margin: 0; }

/* Toggle: first thing on the page, stays reachable while scrolling */
.switch-bar {
  position: sticky; top: 0; z-index: 1001;
  display: flex; justify-content: center;
  padding: 10px 16px calc(10px);
  padding-top: max(10px, env(safe-area-inset-top));
  background: hsla(38, 40%, 92%, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid hsla(30, 20%, 72%, 0.5);
}
.switch {
  display: grid; grid-template-columns: 1fr 1fr; width: 100%; max-width: 360px;
  padding: 4px; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
}
.switch button {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: 600 15px/1 Raleway, sans-serif; letter-spacing: 0.04em; color: var(--muted);
  min-height: 44px; border-radius: 999px; transition: background .2s, color .2s;
}
.switch button[aria-selected="true"] { background: var(--accent); color: hsl(38, 40%, 95%); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.switch button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.hero { text-align: center; padding: 24px 16px 16px; }
.eyebrow { color: var(--accent); letter-spacing: .3em; text-transform: uppercase; font-size: 12px; font-weight: 500; margin: 0 0 8px; }
.hero h1 { font-size: 26px; line-height: 1.2; margin-bottom: 10px; }
.lede { color: var(--muted); font-size: 16px; max-width: 40rem; margin: 0 auto; }
.stats { display: flex; justify-content: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  border-radius: 10px; background: var(--card); border: 1px solid var(--line);
}
.stat svg { width: 18px; height: 18px; stroke: var(--accent); }
.stat b { font-family: Cinzel, serif; font-size: 19px; color: var(--accent); font-weight: 600; }
.stat span { color: var(--muted); font-size: 13px; }
.hint { color: var(--faint); font-size: 12px; font-style: italic; margin: 12px 0 0; min-height: 18px; }

.map-frame {
  margin: 0 12px 18px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line); box-shadow: 0 8px 30px rgba(0,0,0,.12);
  height: min(62vh, 460px); min-height: 340px;
}
#map { height: 100%; width: 100%; background: hsl(38, 40%, 88%); }

.legend {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 18px;
  margin: 0 12px 28px; padding: 10px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
}
.legend-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; border-radius: 50%; }
.d1 { width: 12px; height: 12px; background: rgba(180,155,50,.5); }
.d2 { width: 20px; height: 20px; background: rgba(160,110,45,.7); }
.d3 { width: 28px; height: 28px; background: rgba(140,60,40,.9); }

.shops { margin: 0 12px 28px; }
.shops h2 { font-size: 21px; text-align: center; }
.shops-note { text-align: center; color: var(--faint); font-size: 13px; margin: 4px 0 16px; }
.country { margin-bottom: 18px; }
.country h3 {
  font: 600 12px/1 Raleway, sans-serif; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
.shop {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px; margin-bottom: 8px; min-height: 56px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
}
.shop-main { flex: 1; min-width: 0; appearance: none; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.shop-name { display: block; font-weight: 600; font-size: 15px; }
.shop-meta { display: block; font-size: 13px; color: var(--muted); }
.shop-link {
  flex: none; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--accent); color: var(--accent);
}
.shop-link:active { background: var(--accent); color: var(--bg); }

.foot { text-align: center; padding: 0 16px 36px; color: var(--faint); font-size: 12px; font-style: italic; }
.foot p { margin: 6px 0; }

body[data-view="players"] .only-retailers,
body[data-view="retailers"] .only-players { display: none; }

/* Leaflet overrides */
.leaflet-tooltip { font-family: Raleway, sans-serif; font-size: 13px; }
.leaflet-popup-content { font-family: Raleway, sans-serif; margin: 12px 14px; }
.pop-name { font-family: Cinzel, serif; font-weight: 700; font-size: 15px; display: block; }
.pop-meta { color: var(--muted); font-size: 13px; display: block; margin: 2px 0 8px; }
.pop-link { font-weight: 600; }
.rl-label {
  background: transparent; border: 0; box-shadow: none; padding: 0 0 0 2px;
  font-weight: 600; font-size: 12px; color: var(--ink);
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
}
.rl-label::before { display: none; }

@media (min-width: 768px) {
  .hero { padding: 36px 16px 20px; }
  .hero h1 { font-size: 44px; }
  .lede { font-size: 18px; }
  .stats { gap: 24px; }
  .stat { padding: 12px 20px; }
  .stat b { font-size: 22px; }
  .map-frame { margin: 0 32px 24px; height: 65vh; min-height: 420px; }
  .legend { width: fit-content; margin: 0 auto 40px; }
  .shops { max-width: 980px; margin: 0 auto 40px; padding: 0 32px; }
  #shop-list { columns: 2; column-gap: 28px; }
  .country { break-inside: avoid; }
}
@media (min-width: 1024px) {
  .map-frame { margin: 0 64px 28px; }
}
.leaflet-control-attribution { font-family: Raleway, sans-serif; font-size: 10px; }
.notice {
  margin: 0 0 24px; padding: 14px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  font-size: 14px; color: var(--muted);
}
.notice p { margin: 0 0 8px; }
.notice strong { color: var(--ink); }
.notice-link {
  display: inline-block; margin-top: 4px; padding: 10px 14px; min-height: 44px; border-radius: 8px;
  background: var(--accent); color: hsl(38, 40%, 95%); font-weight: 600; text-decoration: none;
}
@media (min-width: 768px) { .notice { max-width: 640px; margin: 0 auto 32px; } }
