/* =========================================================
   Saechvo Wild West — shared styles (home + ranches)
   warm dark-brown palette, red accent, cinematic details
   ========================================================= */

:root {
  /* RDR2 tobacco/leather palette — deeper, warmer, more sepia */
  --bg-0: #0a0503;
  --bg-1: #130805;
  --bg-2: #1c0d07;
  --panel:   #1a0c06;
  --panel-2: #22130a;
  --panel-3: #2c1c10;
  --ink:     #efdfb8;   /* warmer aged cream */
  --ink-dim: #c8b186;
  --ink-mute:#8a7655;
  --ember:     #e89149;
  --ember-hot: #f4b04a;
  --blood:     #8a2415;
  --blood-hot: #c24027;
  --brass:     #c39452;
  --brass-soft:#8a6a3a;
  --leather:   #3a2112;   /* saddle brown */
  --rule:      rgba(195, 148, 82, 0.30);
  --rule-soft: rgba(195, 148, 82, 0.14);
  --ok: #4aa85a;
  --warn: #3fb0c9;
  --premium: #8a5ad9;
  --bad: #c23d28;

  /* system fonts only — no webfonts */
  --serif:     system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display:   system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display-en:system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --nav-h: 72px;
  --topbar-h: 76px;
  --side-w: 380px;
  --maxw: 1280px;
  --radius: 14px;
  --shadow-1: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-2: 0 30px 80px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(184, 138, 74, .12);
  border: 1px solid var(--rule-soft);
  color: var(--ink-dim);
}

body {
  background:
    radial-gradient(140% 90% at 50% 0%, #3a1808 0%, #1e0d05 38%, #0a0402 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .08; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.95   0 0 0 0 0.9   0 0 0 0 0.8   0 0 0 .7 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.vignette {
  position: fixed; inset: 0; z-index: 91; pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,.4) 100%),
    radial-gradient(80% 70% at 50% 100%, rgba(0,0,0,.55), transparent 70%);
}

/* embers (home) */
.embers { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.embers span {
  position: absolute; bottom: -10px;
  width: 3px; height: 3px; border-radius: 50%;
  background: #f4b04a;
  box-shadow: 0 0 8px rgba(244, 176, 74, .7), 0 0 14px rgba(232, 145, 73, .45);
  opacity: 0;
  animation: ember-rise var(--d, 14s) linear infinite;
  animation-delay: var(--dl, 0s);
}
.embers span:nth-child(1) { left: 6%;  --d: 16s; --dl: -2s; }
.embers span:nth-child(2) { left: 16%; --d: 19s; --dl: -8s; }
.embers span:nth-child(3) { left: 26%; --d: 14s; --dl: -4s; }
.embers span:nth-child(4) { left: 38%; --d: 21s; --dl: -11s; }
.embers span:nth-child(5) { left: 52%; --d: 17s; --dl: -6s; }
.embers span:nth-child(6) { left: 64%; --d: 18s; --dl: -13s; }
.embers span:nth-child(7) { left: 74%; --d: 22s; --dl: -3s; }
.embers span:nth-child(8) { left: 82%; --d: 15s; --dl: -9s; }
.embers span:nth-child(9) { left: 90%; --d: 20s; --dl: -5s; }
.embers span:nth-child(10){ left: 96%; --d: 23s; --dl: -15s; }
@keyframes ember-rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: .9; }
  50%  { transform: translateY(-50vh) translateX(20px); }
  100% { transform: translateY(-100vh) translateX(40px); opacity: 0; }
}

/* type */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; line-height: 1.1; }
h1 { font-size: clamp(40px, 5.2vw, 88px); letter-spacing: .005em; }
h2 { font-size: clamp(26px, 2.8vw, 44px); }
h3 { font-size: clamp(18px, 1.4vw, 22px); letter-spacing: .01em; }
p  { margin: 0 0 1em; color: var(--ink-dim); }
em { font-style: italic; color: var(--ink); }
.muted { color: var(--ink-mute); font-size: 13px; }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-mark { display: inline-grid; place-items: center; filter: drop-shadow(0 4px 10px rgba(155,42,31,.4)); }
.brand-mark img { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.brand-text { display: inline-flex; flex-direction: column; line-height: 1; color: var(--ink); }
.brand-text strong {
  font-family: var(--display); font-weight: 700;
  font-size: 18px; letter-spacing: .22em;
}
.brand-text em {
  font-style: normal; font-size: 10.5px; letter-spacing: .38em;
  color: var(--brass); margin-top: 6px;
  font-family: var(--mono);
}
.brand-lg .brand-text strong { font-size: 17px; letter-spacing: .2em; }
.brand-lg .brand-text em { letter-spacing: .08em; font-family: var(--serif); color: var(--ink-mute); text-transform: none; font-size: 12px; }

/* ---------- CTA ---------- */
.cta, .ghost {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  letter-spacing: .2em;
  font-size: 12px;
  padding: 12px 22px;
  border-radius: 6px;
  transition: transform .2s ease, background .25s ease, color .25s ease, box-shadow .25s ease, border-color .25s ease;
  cursor: pointer;
  text-transform: uppercase;
}
.cta {
  color: var(--ink);
  background: linear-gradient(180deg, #c8402d 0%, #9b2a1f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.4),
    0 6px 18px rgba(155, 42, 31, .35);
}
.cta:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    inset 0 -1px 0 rgba(0,0,0,.4),
    0 10px 24px rgba(155, 42, 31, .5);
}
.cta-sm { padding: 10px 18px; font-size: 11px; }
.cta-full { width: 100%; justify-content: center; padding: 14px 22px; }
.ghost {
  color: var(--ink-dim);
  border: 1px solid var(--rule);
  background: rgba(26, 14, 10, .4);
}
.ghost:hover { color: var(--ink); border-color: var(--ember); background: rgba(232, 145, 73, .08); }
.ghost-sm { padding: 8px 14px; font-size: 11px; letter-spacing: .15em; }

/* ========== HOME: NAV ========== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 48px);
  transition: background .3s ease, backdrop-filter .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(13, 6, 4, .8);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom-color: var(--rule-soft);
}

/* ========== HOME: HERO ========== */
.hero-simple {
  position: relative;
  padding: calc(var(--nav-h) + clamp(40px, 10vh, 120px)) 20px clamp(40px, 6vh, 80px);
  text-align: center;
  z-index: 2;
}
.hero-simple-inner { max-width: 1020px; margin: 0 auto; }
.hero-tag {
  display: inline-block;
  margin: 0 0 18px;
  padding: 6px 14px;
  border: 1px solid var(--rule-soft);
  border-radius: 99px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--brass);
  background: rgba(26, 14, 10, .4);
  animation: hero-in 1s cubic-bezier(.2,.7,.1,1) both;
}

.welcome {
  font-family: var(--display); font-weight: 700;
  color: var(--ink);
  letter-spacing: .01em;
  line-height: 1.12;
  margin: 0 0 24px;
  text-shadow: 0 2px 24px rgba(0,0,0,.5);
  animation: hero-in 1.2s cubic-bezier(.2,.7,.1,1) .1s both;
  text-transform: uppercase;
}
.welcome-line { display: block; font-style: normal; }
.welcome-accent {
  display: inline;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(180deg, #f4584a, #c8402d 60%, #7a1d12);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px rgba(200, 64, 45, .35));
}
.welcome-sub {
  max-width: 640px; margin: 0 auto 32px;
  color: var(--ink-dim);
  font-size: clamp(14px, 1.15vw, 17px);
  animation: hero-in 1.4s cubic-bezier(.2,.7,.1,1) .2s both;
}
@keyframes hero-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.divider {
  display: inline-flex; align-items: center; gap: 14px;
  opacity: 0;
  animation: hero-in 1.6s cubic-bezier(.2,.7,.1,1) .3s forwards;
}
.divider-line {
  width: 64px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}
.divider-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ember-hot);
  box-shadow: 0 0 10px rgba(244, 176, 74, .8);
  animation: dot-pulse 2.6s ease-in-out infinite;
}
@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(244, 176, 74, .5); }
  50%      { box-shadow: 0 0 18px rgba(244, 176, 74, 1); }
}

/* ========== HOME: CATALOG ========== */
.catalog { padding: 20px clamp(16px, 4vw, 48px) 80px; position: relative; z-index: 2; }
.cards {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; gap: 24px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

.card { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.1,1); }
.card.is-in { opacity: 1; transform: none; }

.card-inner {
  --accent: var(--ember);
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  box-shadow: var(--shadow-1);
  isolation: isolate;
  transition: transform .4s cubic-bezier(.2,.7,.1,1), border-color .4s ease, box-shadow .4s ease;
  aspect-ratio: 16 / 11;
}
.card-inner:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--rule));
  box-shadow: 0 22px 56px rgba(0, 0, 0, .55), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.card-art { position: absolute; inset: 0; display: block; }
.card-art svg {
  width: 100%; height: 100%;
  transform: scale(1.02);
  transition: transform .7s cubic-bezier(.2,.7,.1,1), filter .7s ease;
  filter: saturate(.9) contrast(1.05);
}
.card-inner:hover .card-art svg { transform: scale(1.08); filter: saturate(1.05) contrast(1.1); }
.card-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(13, 6, 4, .35) 55%, rgba(13, 6, 4, .92) 100%);
  pointer-events: none;
}
.card-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 24px; z-index: 2; }
.card-body h3 {
  color: var(--ink); font-family: var(--display);
  font-size: clamp(19px, 1.6vw, 25px);
  letter-spacing: .03em; text-transform: uppercase;
  margin-bottom: 6px;
  text-shadow: 0 2px 10px rgba(0,0,0,.6); transition: color .3s ease;
}
.card-inner:hover .card-body h3 { color: var(--ember-hot); }
.card-body p {
  color: var(--ink-dim); font-size: 14px; margin: 0; max-width: 90%;
  text-shadow: 0 1px 8px rgba(0,0,0,.6);
}
.card-inner::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0; transition: opacity .4s ease; z-index: 3;
}
.card-inner:hover::before { opacity: 1; }

/* HOME footer */
.foot-min {
  padding: 28px clamp(20px, 4vw, 48px);
  border-top: 1px solid var(--rule-soft);
  display: flex; justify-content: space-between; gap: 16px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-mute);
  flex-wrap: wrap; position: relative; z-index: 2;
}
.foot-min a:hover { color: var(--ember); }

/* ================================================================
   PAGE: RANCHES / MAP — full immersive redesign
   ================================================================ */

.page-map {
  background: #0d0604;
  min-height: 100vh;
  overflow: hidden;
}

/* ---------- TOP BAR ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 4px clamp(16px, 2.5vw, 32px) 0;   /* 4px top = room for the blood strip */
  gap: 24px;
  background:
    linear-gradient(180deg, #1e100a 0%, #130806 50%, #090402 100%);
  border-bottom: 1px solid var(--leather);
  box-shadow:
    0 6px 26px rgba(0, 0, 0, .7),
    inset 0 -2px 0 rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(195, 148, 82, .1);
  isolation: isolate;
}
/* iconic Red Dead blood-strip at the very top edge */
.topbar::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #6b1a10, #c8402d 40%, #c8402d 60%, #6b1a10);
  box-shadow: 0 1px 6px rgba(200, 64, 45, .5);
  z-index: 2;
}
/* leather grain overlay on the topbar itself */
.topbar > * { position: relative; z-index: 1; }
.topbar {
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='80'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.6 .9' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5   0 0 0 0 0.28   0 0 0 0 0.14   0 0 0 .35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>"),
    linear-gradient(180deg, #1e100a 0%, #130806 50%, #090402 100%);
  background-blend-mode: overlay, normal;
}
/* brass hairline under the topbar */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
  opacity: .6;
}

.stats {
  display: inline-flex; gap: 28px;
  padding: 9px 24px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(34, 19, 10, .7), rgba(14, 7, 4, .7));
  box-shadow:
    inset 0 1px 0 rgba(195, 148, 82, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.stat b { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; color: var(--ink); }
.stat span { font-family: var(--mono); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--ink-mute); }
.stat-good b { color: var(--ok); }
.stat-bad b  { color: var(--bad); }

.topbar-right { display: inline-flex; align-items: center; gap: 12px; justify-content: flex-end; }

.discord-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(180deg, #5865f2, #404eed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(88, 101, 242, .4);
  transition: transform .2s ease, box-shadow .2s ease;
}
.discord-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(88, 101, 242, .6); }

@media (max-width: 980px) {
  .topbar { grid-template-columns: auto 1fr; gap: 12px; }
  .stats { display: none; }
}

/* ---------- APP SHELL ---------- */
.app {
  display: grid;
  grid-template-columns: 1fr var(--side-w);   /* map left · sidebar right */
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
}
@media (max-width: 860px) {
  :root { --side-w: 100%; }
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr minmax(280px, 40vh); }
  .side { border-left: 0 !important; border-top: 1px solid var(--rule-soft); }
}

/* ---------- SIDEBAR — aged tobacco panel with subtle leather grain ---------- */
.side {
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, #20120a 0%, #180c06 55%, #0c0503 100%);
  border-left: 1px solid var(--rule);
  box-shadow:
    -24px 0 50px rgba(0, 0, 0, .55),
    inset 1px 0 0 rgba(195, 148, 82, .08),
    inset 0 1px 0 rgba(195, 148, 82, .06);
  min-height: 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
}
.side::before {
  /* heavy leather grain — clearly visible */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.55   0 0 0 0 0.30   0 0 0 0 0.15   0 0 0 .9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>"),
    radial-gradient(140% 100% at 50% -10%, rgba(195, 148, 82, .08), transparent 60%);
  opacity: .55;
  mix-blend-mode: overlay;
}
.side::after {
  /* vertical hairline accent on the inside edge */
  content: ""; position: absolute; left: 6px; top: 16px; bottom: 16px; width: 1px;
  background: linear-gradient(180deg, transparent, var(--rule-soft) 15%, var(--rule-soft) 85%, transparent);
  pointer-events: none;
}

.side-head {
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: linear-gradient(180deg, rgba(26, 14, 10, .4), transparent);
  display: flex; flex-direction: column; gap: 12px;
}
.side-top { display: flex; align-items: baseline; gap: 10px; }
.side-title {
  font-family: var(--display); font-size: 22px; font-weight: 700;
  color: var(--ink); letter-spacing: .04em; margin: 0;
  text-transform: uppercase;
}
.side-count {
  font-family: var(--mono); font-size: 11px; letter-spacing: .2em;
  color: var(--ink-mute);
  padding: 2px 8px; border: 1px solid var(--rule-soft); border-radius: 99px;
  background: rgba(26, 14, 10, .5);
}

/* search */
.search-wrap {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(20, 10, 6, .75), rgba(10, 5, 3, .75));
  color: var(--ink-mute);
  transition: border-color .2s ease, color .2s ease, background .2s ease, box-shadow .2s ease;
  box-shadow:
    inset 0 1px 0 rgba(195, 148, 82, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.search-wrap:focus-within {
  border-color: var(--ember);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(195, 148, 82, .12),
    0 0 0 2px rgba(232, 145, 73, .15);
}
.search-wrap input {
  flex: 1; border: 0; background: transparent;
  color: var(--ink); font: inherit; outline: none;
  font-size: 14px;
}
.search-wrap input::placeholder { color: var(--ink-mute); }
.search-wrap kbd { flex-shrink: 0; opacity: .7; }
.search-wrap:focus-within kbd { opacity: 0; }

/* chips */
.chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.chip-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 10px;
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  background: rgba(13, 6, 4, .55);
  color: var(--ink-dim);
  font-size: 13px; font-family: var(--serif);
  white-space: nowrap;
  transition: color .2s, border-color .2s, background .2s, transform .15s, box-shadow .2s;
  text-align: center;
  min-width: 0;
}
.chip-btn:hover {
  color: var(--ink);
  border-color: var(--brass-soft);
  background: rgba(26, 14, 10, .75);
  transform: translateY(-1px);
}
.chip-btn:active { transform: scale(.97); }
.chip-btn.is-active {
  color: var(--ink);
  background: linear-gradient(180deg, #3a1a10, #1a0906);
  border-color: var(--ember);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 0 0 1px var(--brass-soft),
    0 4px 12px rgba(232, 145, 73, .2);
}
.chip-btn[data-filter="farm"].is-active  { border-color: #e8b53a; box-shadow: 0 0 0 1px #e8b53a, 0 4px 14px rgba(232, 181, 58, .3); }
.chip-btn[data-filter="ranch"].is-active { border-color: #d74e3a; box-shadow: 0 0 0 1px #d74e3a, 0 4px 14px rgba(215, 78, 58, .3); }
.chip-btn[data-filter="house"].is-active { border-color: #58b5c9; box-shadow: 0 0 0 1px #58b5c9, 0 4px 14px rgba(88, 181, 201, .3); }
.chip-btn .dot { width: 8px; height: 8px; flex-shrink: 0; }

.chip-count {
  font-family: var(--mono); font-size: 10.5px; font-weight: 400;
  letter-spacing: .05em;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(184, 138, 74, .15);
  border: 1px solid var(--rule-soft);
  color: var(--brass);
  min-width: 22px; text-align: center;
  line-height: 1.2;
  transition: background .2s, color .2s, border-color .2s;
}
.chip-btn.is-active .chip-count {
  background: rgba(232, 145, 73, .22);
  color: var(--ember-hot);
  border-color: rgba(232, 145, 73, .4);
}
.chip-btn[data-filter="farm"].is-active  .chip-count { background: rgba(232, 181, 58, .2); color: #f4c75a; border-color: rgba(232, 181, 58, .45); }
.chip-btn[data-filter="ranch"].is-active .chip-count { background: rgba(215, 78, 58, .2);  color: #e87060; border-color: rgba(215, 78, 58, .45); }
.chip-btn[data-filter="house"].is-active .chip-count { background: rgba(88, 181, 201, .2); color: #7ad0e2; border-color: rgba(88, 181, 201, .45); }

/* region select */
.select-wrap { position: relative; }
.region {
  width: 100%;
  padding: 10px 34px 10px 14px;
  background:
    linear-gradient(180deg, rgba(20, 10, 6, .75), rgba(10, 5, 3, .75));
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--ink);
  font: inherit; font-size: 14px;
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-shadow:
    inset 0 1px 0 rgba(195, 148, 82, .08),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.region:focus { border-color: var(--ember); outline: none; }
.region option { background: #1a0d0a; color: var(--ink); }
.select-arrow {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 8px; color: var(--ink-mute); pointer-events: none;
}

/* list */
.ranch-list {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 12px 12px 20px;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--brass-soft) transparent;
  scroll-behavior: smooth;
}
.ranch-list::-webkit-scrollbar { width: 8px; }
.ranch-list::-webkit-scrollbar-track { background: transparent; }
.ranch-list::-webkit-scrollbar-thumb {
  background: var(--brass-soft); border-radius: 4px;
  border: 2px solid transparent; background-clip: padding-box;
}

/* ranch card */
.ranch {
  position: relative;
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
  animation: ranch-in .4s cubic-bezier(.2,.7,.1,1) both;
}
@keyframes ranch-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.ranch:hover {
  transform: translateY(-2px);
  border-color: var(--brass-soft);
  background: var(--panel-2);
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.ranch.is-active {
  transform: translateY(-2px);
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
}
.ranch.is-active.ranch-farm  { border-color: #e8b53a; box-shadow: 0 0 0 1px #e8b53a, 0 10px 26px rgba(232, 181, 58, .22); }
.ranch.is-active.ranch-ranch { border-color: #d74e3a; box-shadow: 0 0 0 1px #d74e3a, 0 10px 26px rgba(215, 78, 58, .22); }
.ranch.is-active.ranch-house { border-color: #58b5c9; box-shadow: 0 0 0 1px #58b5c9, 0 10px 26px rgba(88, 181, 201, .22); }
.ranch.is-active::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: 3px; height: 56%; transform: translateY(-50%);
  border-radius: 0 3px 3px 0;
  background: var(--ember-hot);
}
.ranch.is-active.ranch-farm::before  { background: #e8b53a; box-shadow: 0 0 10px rgba(232, 181, 58, .6); }
.ranch.is-active.ranch-ranch::before { background: #d74e3a; box-shadow: 0 0 10px rgba(215, 78, 58, .6); }
.ranch.is-active.ranch-house::before { background: #58b5c9; box-shadow: 0 0 10px rgba(88, 181, 201, .6); }

.ranch-thumb {
  position: relative;
  width: 68px; height: 68px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.ranch-thumb svg { width: 100%; height: 100%; }
.ranch-thumb::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 1px rgba(184, 138, 74, .2);
  border-radius: 8px;
}
.ranch-thumb .thumb-badge {
  position: absolute; right: 4px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(13, 6, 4, .9);
}

.ranch-main { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.ranch-name {
  font-family: var(--display); font-weight: 700;
  font-size: 15px; letter-spacing: .035em;
  color: var(--ink);
  text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ranch-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-mute); }
.ranch-meta .sep { color: var(--rule); }
.ranch-meta .type { color: var(--brass); font-family: var(--mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
.ranch-loc { display: inline-flex; align-items: center; gap: 4px; }
.ranch-loc svg { width: 10px; height: 10px; flex-shrink: 0; }

.ranch-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  justify-content: center; flex-shrink: 0;
}
.ranch-price {
  font-family: var(--display); font-weight: 700;
  color: var(--ember-hot);
  font-size: 15px;
  line-height: 1;
}
.ranch-price small { font-size: 10px; color: var(--ink-mute); font-weight: 400; margin-left: 2px; font-family: var(--serif); }
.ranch-price.is-free { color: var(--warn); }

.status-pill {
  font-family: var(--mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px;
}
.status-sold      { background: rgba(194, 61, 40, .18);  color: #e87669; border: 1px solid rgba(194, 61, 40, .4); font-weight: 700; }
.status-available { background: rgba(74, 168, 90, .18);  color: #8ed99d; border: 1px solid rgba(74, 168, 90, .4); }

/* list type badges (right-side "FARM / RANCH / HOUSE" chip) */
.type-farm  { color: #e8b53a !important; }
.type-ranch { color: #d74e3a !important; }
.type-house { color: #58b5c9 !important; }

/* thumbnail badges — colored corner dot on each card */
.badge-farm         { background: #e8b53a; box-shadow: 0 0 0 2px rgba(13,6,4,.9), 0 0 6px rgba(232,181,58,.5); }
.badge-farm.is-sold { background: #8a5f10; box-shadow: 0 0 0 2px rgba(13,6,4,.95), 0 0 6px rgba(138,95,16,.7); }
.badge-ranch         { background: #d74e3a; box-shadow: 0 0 0 2px rgba(13,6,4,.9), 0 0 6px rgba(215,78,58,.5); }
.badge-ranch.is-sold { background: #6e1a0f; box-shadow: 0 0 0 2px rgba(13,6,4,.95), 0 0 6px rgba(110,26,15,.7); }
.badge-house         { background: #58b5c9; box-shadow: 0 0 0 2px rgba(13,6,4,.9), 0 0 6px rgba(88,181,201,.5); }
.badge-house.is-sold { background: #1a4a58; box-shadow: 0 0 0 2px rgba(13,6,4,.95), 0 0 6px rgba(26,74,88,.7); }

/* sold list row: bolder left edge + subtle tint */
.ranch.is-sold::before {
  content: ""; position: absolute; left: 0; top: 10%; bottom: 10%; width: 3px;
  border-radius: 0 3px 3px 0;
}
.ranch.is-sold.ranch-farm::before  { background: #8a5f10; box-shadow: 0 0 8px rgba(138, 95, 16, .5); }
.ranch.is-sold.ranch-ranch::before { background: #6e1a0f; box-shadow: 0 0 8px rgba(110, 26, 15, .5); }
.ranch.is-sold.ranch-house::before { background: #1a4a58; box-shadow: 0 0 8px rgba(26, 74, 88, .5); }

/* legend/status dots */
.dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
/* legacy status dots — kept for any remaining references */
.dot-available { background: var(--ok); box-shadow: 0 0 6px rgba(74, 168, 90, .5); }
.dot-sold      { background: var(--bad); box-shadow: 0 0 6px rgba(194, 61, 40, .5); }

/* category dots (for legend & filter chips) */
.dot-farm          { background: #e8b53a; box-shadow: 0 0 6px rgba(232, 181, 58, .55); }
.dot-farm.is-sold  { background: #8a5f10; box-shadow: 0 0 6px rgba(138, 95, 16, .7); }
.dot-ranch         { background: #d74e3a; box-shadow: 0 0 6px rgba(215, 78, 58, .55); }
.dot-ranch.is-sold { background: #6e1a0f; box-shadow: 0 0 6px rgba(110, 26, 15, .7); }
.dot-house         { background: #58b5c9; box-shadow: 0 0 6px rgba(88, 181, 201, .55); }
.dot-house.is-sold { background: #1a4a58; box-shadow: 0 0 6px rgba(26, 74, 88, .7); }

/* empty state */
.side-empty {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; color: var(--ink-mute);
  padding: 40px 20px;
  pointer-events: none;
}
.side-empty svg { margin: 0 auto 12px; color: var(--brass-soft); opacity: .7; }
.side-empty p { color: var(--ink-dim); font-family: var(--display); font-size: 18px; margin: 0 0 4px; }
.side-empty span { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-mute); }

/* ---------- MAP STAGE ---------- */
.map-stage {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(100% 80% at 50% 50%, #d8bb82, #b4915a 55%, #7a5a30 100%);
  isolation: isolate;
  contain: layout paint;
}
.map-stage::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(100% 80% at 50% 50%, transparent 50%, rgba(0,0,0,.22) 100%),
    linear-gradient(180deg, rgba(0,0,0,.15), transparent 20%, transparent 80%, rgba(0,0,0,.2));
  pointer-events: none;
}
/* subtle grain directly on the map surface for authenticity */
.map-stage::after {
  content: ""; position: absolute; inset: 0; z-index: 4;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3   0 0 0 0 0.2   0 0 0 0 0.1   0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .08;
  mix-blend-mode: multiply;
  pointer-events: none;
}

/* loader */
.map-loading {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  align-content: center;
  gap: 16px;
  background: radial-gradient(60% 40% at 50% 50%, rgba(13, 6, 4, .85), rgba(13, 6, 4, .6));
  backdrop-filter: blur(4px);
  color: var(--ink);
  transition: opacity .4s ease, visibility .4s ease;
}
.map-loading p { font-family: var(--mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--ink-dim); margin: 0; text-align: center; }
.map-loading.is-done { opacity: 0; visibility: hidden; }
.loader-ring {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid var(--rule-soft);
  border-top-color: var(--ember);
  animation: spin 1s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.map-viewport {
  position: absolute; inset: 0; z-index: 2;
  cursor: grab;
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
  touch-action: none;
}
.map-viewport.is-dragging { cursor: grabbing; }

.map-canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.map-img {
  display: block;
  width: 100%; height: auto;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
  filter: sepia(.15) saturate(1.05) contrast(1.06) brightness(.98);
  image-rendering: auto;
}

/* map controls — leather button stack, right side */
.map-controls {
  position: absolute; right: 18px; top: 18px; z-index: 5;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, rgba(28, 16, 10, .88), rgba(14, 7, 4, .88));
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 8px 24px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(195, 148, 82, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
.map-btn {
  width: 38px; height: 38px;
  color: var(--ink);
  display: grid; place-items: center;
  transition: background .2s ease, color .2s ease;
}
.map-btn:hover { background: rgba(232, 145, 73, .18); color: var(--ember-hot); }
.map-btn + .map-btn { border-top: 1px solid var(--rule-soft); }
.map-btn-sep { height: 1px; background: var(--rule); margin: 2px 0; }

/* fullscreen icon swap */
#map-full .ico-full-out { display: none; }
.map-stage.is-fullscreen #map-full .ico-full-in  { display: none; }
.map-stage.is-fullscreen #map-full .ico-full-out { display: block; }
.map-stage:fullscreen { width: 100vw; height: 100vh; }
.map-stage:-webkit-full-screen { width: 100vw; height: 100vh; }

/* pins — counter-scaled so they stay the same visual size regardless of map zoom */
.pins { position: absolute; inset: 0; }
.pin {
  position: absolute;
  width: 0; height: 0;
  z-index: 2;
  pointer-events: auto;
  animation: pin-fade .45s var(--pin-delay, 0s) both;
}
@keyframes pin-fade { from { opacity: 0; } to { opacity: 1; } }

.pin-inner {
  position: absolute;
  bottom: 0; left: 0;
  width: 44px; height: 56px;
  transform: translateX(-50%) scale(var(--inv-scale, 1));
  transform-origin: 50% 100%;
  cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,.6));
  transition: transform .2s ease, filter .2s ease;
}
.pin:hover { z-index: 10; }
.pin:hover .pin-inner {
  transform: translateX(-50%) scale(calc(var(--inv-scale, 1) * 1.15));
  filter: drop-shadow(0 8px 12px rgba(0,0,0,.7)) brightness(1.1);
}
.pin.is-active { z-index: 11; }
.pin.is-active .pin-inner {
  transform: translateX(-50%) scale(calc(var(--inv-scale, 1) * 1.2));
  filter: drop-shadow(0 8px 14px rgba(232,145,73,.7)) brightness(1.15);
}

.pin-svg { width: 100%; height: 100%; display: block; }

/* category × state: available (regular) vs sold (BOLD / saturated)
   FARM   = goldenrod → deep amber
   RANCH  = crimson   → blood red
   HOUSE  = sky teal  → deep sea blue */
.pin-farm          .pin-bg { fill: #e8b53a; stroke: #2a1808; stroke-width: 1.4; }
.pin-farm.is-sold  .pin-bg { fill: #8a5f10; stroke: #000;    stroke-width: 2.2; }

.pin-ranch         .pin-bg { fill: #d74e3a; stroke: #2a0a05; stroke-width: 1.4; }
.pin-ranch.is-sold .pin-bg { fill: #6e1a0f; stroke: #000;    stroke-width: 2.2; }

.pin-house         .pin-bg { fill: #58b5c9; stroke: #06222a; stroke-width: 1.4; }
.pin-house.is-sold .pin-bg { fill: #1a4a58; stroke: #000;    stroke-width: 2.2; }

/* sold pins — heavier shadow to feel BOLD */
.pin.is-sold .pin-inner { filter: drop-shadow(0 5px 8px rgba(0,0,0,.75)); }

/* pin tooltip — inside pin-inner so it scales consistently */
.pin-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%; transform: translateX(-50%);
  padding: 6px 10px;
  background: rgba(13, 6, 4, .96);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  font-size: 12px; color: var(--ink);
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .6);
  font-family: var(--serif);
}
.pin-tip::after {
  content: ""; position: absolute; bottom: -4px; left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 6px; height: 6px;
  background: rgba(13, 6, 4, .96);
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.pin:hover .pin-tip, .pin.is-active .pin-tip { opacity: 1; }
.pin-tip b { color: var(--ember-hot); font-weight: 600; }

/* price panel — RDR2 wanted-poster feel, top-left */
.price-panel {
  position: absolute; left: 18px; top: 18px; z-index: 5;
  background:
    linear-gradient(180deg, rgba(28, 16, 10, .85), rgba(14, 7, 4, .85));
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 14px 16px;
  min-width: 240px;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .6),
    inset 0 1px 0 rgba(195, 148, 82, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
  transition: opacity .3s ease, transform .3s ease;
  position: absolute; /* re-anchor */
  isolation: isolate;
}
.price-panel::before {
  /* inner double-border like an old document */
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  z-index: -1;
}
/* hide price panel while detail is open so it doesn't show behind */
.map-stage:has(.detail.is-open) .price-panel { opacity: 0; transform: translateX(-12px); pointer-events: none; }
.price-panel h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--serif); font-size: 11.5px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule-soft);
}
.price-panel ul { display: flex; flex-direction: column; gap: 8px; }
.price-panel li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-dim); }
.pchip {
  display: inline-grid; place-items: center;
  min-width: 60px;
  padding: 5px 8px;
  border-radius: 5px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
}
.pchip-premium { background: rgba(138, 90, 217, .2); color: #b896e8; border: 1px solid rgba(138, 90, 217, .4); }
.pchip-mid     { background: rgba(184, 138, 74, .18); color: var(--ember); border: 1px solid rgba(184, 138, 74, .45); }
.pchip-free    { background: rgba(74, 168, 90, .18); color: #8ed99d; border: 1px solid rgba(74, 168, 90, .4); }

@media (max-width: 720px) { .price-panel { display: none; } }

/* legend — matches price-panel wanted-poster treatment */
.legend {
  position: absolute; left: 18px; bottom: 18px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(28, 16, 10, .85), rgba(14, 7, 4, .85));
  border: 1px solid var(--rule);
  border-radius: 4px;
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  box-shadow:
    0 14px 34px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(195, 148, 82, .14),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
  transition: opacity .3s ease, transform .3s ease;
  isolation: isolate;
}
.legend::before {
  content: ""; position: absolute; inset: 4px; pointer-events: none;
  border: 1px solid var(--rule-soft);
  border-radius: 2px;
  z-index: -1;
}
.map-stage:has(.detail.is-open) .legend { opacity: 0; transform: translateX(-12px); pointer-events: none; }
.legend h4 {
  font-family: var(--serif); font-size: 10.5px; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--ember);
  margin: 0 0 6px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.legend-row {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-dim);
}
.legend-grid {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 8px 14px;
  align-items: center;
  padding: 4px 2px 2px;
}
.legend-head {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-mute);
  text-align: center;
}
.legend-head-bold { color: var(--ember); font-weight: 700; }
.legend-cat {
  font-family: var(--serif); font-size: 12.5px; color: var(--ink-dim);
  padding-right: 6px;
}
.legend-grid .dot {
  justify-self: center;
  width: 11px; height: 11px;
}
.legend-note {
  margin: 8px 0 0; padding-top: 8px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-mute);
  text-align: center;
}

/* ---------- DETAIL PANEL ---------- */
.scrim {
  position: absolute; inset: 0; z-index: 14;
  background: rgba(13, 6, 4, .5);
  backdrop-filter: blur(2px);
  opacity: 0; visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.scrim.is-open { opacity: 1; visibility: visible; }

.detail {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: min(460px, 92vw);
  z-index: 15;
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, #22130a 0%, #160a05 55%, #0c0503 100%);
  border-right: 1px solid var(--rule);
  box-shadow:
    30px 0 60px rgba(0, 0, 0, .65),
    inset -1px 0 0 rgba(195, 148, 82, .08);
  transform: translateX(-102%);
  transition: transform .5s cubic-bezier(.22,.9,.25,1.04);
  overflow: hidden;
  will-change: transform;
  isolation: isolate;
}
.detail::before {
  /* leather grain overlay to match sidebar */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08   0 0 0 0 0.04   0 0 0 0 0.02   0 0 0 1 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  opacity: .22;
  mix-blend-mode: overlay;
}
.detail.is-open { transform: translateX(0); }

.detail-close {
  position: absolute; right: 14px; top: 14px; z-index: 3;
  width: 36px; height: 36px;
  border-radius: 8px;
  background: rgba(13, 6, 4, .7);
  border: 1px solid var(--rule-soft);
  color: var(--ink-dim);
  display: grid; place-items: center;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.detail-close:hover { color: var(--ink); background: rgba(232, 145, 73, .12); border-color: var(--ember); transform: rotate(90deg); }

.detail-photo {
  position: relative;
  height: 240px;
  flex-shrink: 0;
  overflow: hidden;
}
.detail-photo svg { width: 100%; height: 100%; }
.detail-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(13, 6, 4, .5) 75%, rgba(13, 6, 4, .98) 100%);
}
/* top-edge category accent line */
.detail-photo::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  z-index: 2;
  transition: background .3s ease;
}
.detail:has(.type-farm)  .detail-photo::before { background: linear-gradient(90deg, transparent, #e8b53a 30%, #e8b53a 70%, transparent); box-shadow: 0 0 12px rgba(232, 181, 58, .7); }
.detail:has(.type-ranch) .detail-photo::before { background: linear-gradient(90deg, transparent, #d74e3a 30%, #d74e3a 70%, transparent); box-shadow: 0 0 12px rgba(215, 78, 58, .7); }
.detail:has(.type-house) .detail-photo::before { background: linear-gradient(90deg, transparent, #58b5c9 30%, #58b5c9 70%, transparent); box-shadow: 0 0 12px rgba(88, 181, 201, .7); }

.detail-body {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 0 26px 26px;
  margin-top: -60px;
  position: relative; z-index: 2;
}
.detail-head { margin-bottom: 22px; }
.detail-status {
  display: inline-block;
  font-family: var(--mono); font-size: 10px; letter-spacing: .2em;
  text-transform: uppercase;
  padding: 3px 9px; border-radius: 3px;
  margin-bottom: 10px;
  backdrop-filter: blur(4px);
}
.detail-status.status-sold      { background: rgba(194, 61, 40, .22);  color: #f19d90; border: 1px solid rgba(194, 61, 40, .5); }
.detail-status.status-available { background: rgba(74, 168, 90, .22);  color: #a8e2b5; border: 1px solid rgba(74, 168, 90, .5); }
.detail-status.status-free      { background: rgba(63, 176, 201, .22); color: #8cdbea; border: 1px solid rgba(63, 176, 201, .5); }
.detail-status.status-premium   { background: rgba(138, 90, 217, .22); color: #c9aef0; border: 1px solid rgba(138, 90, 217, .5); }

.detail-head h2 {
  font-family: var(--display); font-size: 28px; font-weight: 700;
  color: var(--ink); letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 6px;
  text-shadow: 0 2px 14px rgba(0,0,0,.7);
  line-height: 1.15;
}
.detail-loc { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-dim); }
.detail-loc svg { color: var(--brass); flex-shrink: 0; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 22px;
}
.detail-cell {
  padding: 12px 14px;
  background: rgba(26, 14, 10, .7);
  border: 1px solid var(--rule-soft);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.detail-label {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-mute);
}
.detail-cell b {
  font-family: var(--display); font-weight: 700;
  font-size: 18px; color: var(--ink);
  line-height: 1.2;
}
.detail-cell .accent { color: var(--ember-hot); }

.detail-desc {
  color: var(--ink-dim); font-size: 14.5px; line-height: 1.65;
  margin: 0 0 22px;
}

.detail-actions { margin-bottom: 16px; }

.detail-hint {
  font-family: var(--mono); font-size: 10px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-mute);
  text-align: center; margin: 0;
}

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

/* =========================================================================
   PAGE: RANCHES — LIGHT PARCHMENT / TAN THEME (RDR2 map-website style)
   Scoped to body.page-map so the home page stays dark-themed.
   Farm / ranch / house colors are preserved.
   ========================================================================= */

body.page-map {
  /* RDR2 pause-menu palette: dark frame + rich cream parchment panels
     · panels stay cream → dark text for legibility (sidebar, floating, detail)
     · topbar + body are deep tobacco dark with cream text
     · red accents for CTAs, brass hairlines for trim */
  --bg-0:    #0e0503;   /* page bg (dark) */
  --bg-1:    #180a06;
  --bg-2:    #241108;
  --panel:   #e6cd9b;   /* cream parchment (sidebar, cards, floating) */
  --panel-2: #f0d8a8;   /* hover */
  --panel-3: #d6b983;   /* active */
  --ink:     #2a1810;   /* dark text on cream */
  --ink-dim: #5a3e22;
  --ink-mute:#8a6a44;
  --cream:     #e6cd9b; /* matches --panel, for clarity elsewhere */
  --cream-2:   #f0d8a8;
  --brass:     #7a5628; /* dark brass for cream-panel trim */
  --brass-soft:#5a4220;
  --rule:      rgba(60, 40, 18, 0.38);
  --rule-soft: rgba(60, 40, 18, 0.18);

  background:
    radial-gradient(140% 90% at 50% 0%, #2a1408 0%, #160a05 42%, #080302 100%);
  color: var(--ink);
}

/* overlays calibrated for light bg */
.page-map .grain     { opacity: .12; mix-blend-mode: multiply; }
.page-map .vignette  { display: none; }

/* ---------- TOPBAR (dark, signature RDR2 frame) ---------- */
.page-map .topbar {
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='80'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.6 .9' numOctaves='2' seed='7' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5   0 0 0 0 0.28   0 0 0 0 0.14   0 0 0 .32 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>"),
    linear-gradient(180deg, #1a0d0a 0%, #0e0604 100%);
  background-blend-mode: overlay, normal;
  border-bottom: 1px solid #3a2112;
  box-shadow:
    0 4px 24px rgba(0, 0, 0, .7),
    inset 0 -2px 0 rgba(0, 0, 0, .7),
    inset 0 1px 0 rgba(230, 205, 155, .08);
}
.page-map .topbar::before {
  background: linear-gradient(90deg, #6b1a10, #c8402d 40%, #c8402d 60%, #6b1a10);
  box-shadow: 0 1px 6px rgba(200, 64, 45, .55);
}
.page-map .topbar::after {
  background: linear-gradient(90deg, transparent, #c39452, transparent);
  opacity: .55;
}
.page-map .brand-text strong { color: var(--cream); }
.page-map .brand-text em     { color: #c8b186; }

.page-map .stats {
  background:
    linear-gradient(180deg, rgba(34, 19, 10, .75), rgba(14, 7, 4, .75));
  border: 1px solid rgba(195, 148, 82, .35);
  box-shadow:
    inset 0 1px 0 rgba(230, 205, 155, .1),
    inset 0 -1px 0 rgba(0, 0, 0, .5);
}
.page-map .stat b      { color: var(--cream); }
.page-map .stat span   { color: #8a7655; }
.page-map .stat-good b { color: #7acf8a; }
.page-map .stat-bad b  { color: #e87669; }

.page-map .ghost {
  color: #c8b186;
  background: rgba(34, 19, 10, .5);
  border-color: rgba(195, 148, 82, .35);
}
.page-map .ghost:hover {
  color: var(--cream);
  background: rgba(195, 148, 82, .15);
  border-color: #c39452;
}

/* ---------- SIDEBAR ---------- */
.page-map .side {
  background:
    linear-gradient(180deg, #ecd5a3 0%, #d8bc84 100%);
  border-left: 1px solid var(--brass-soft);
  box-shadow:
    -24px 0 40px rgba(60, 40, 18, .18),
    inset 1px 0 0 rgba(255, 240, 200, .5);
}
.page-map .side::before {
  /* subtle paper-fibre grain on cream */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='320' height='320'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.55' numOctaves='3' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.28   0 0 0 0 0.17   0 0 0 0 0.09   0 0 0 .45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  opacity: .35;
  mix-blend-mode: multiply;
}
.page-map .side::after { background: linear-gradient(180deg, transparent, var(--rule-soft) 15%, var(--rule-soft) 85%, transparent); }

.page-map .side-head   { border-bottom: 1px solid var(--rule); background: linear-gradient(180deg, rgba(255, 240, 200, .3), transparent); }
.page-map .side-title  { color: var(--ink); }
.page-map .side-count  { color: var(--ink-dim); background: rgba(60, 40, 18, .08); border-color: var(--rule-soft); }

/* search, region select */
.page-map .search-wrap {
  background: #f2dcaa;
  border: 1px solid var(--brass-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .6),
    inset 0 -1px 0 rgba(60, 40, 18, .12);
}
.page-map .search-wrap input { color: var(--ink); }
.page-map .search-wrap input::placeholder { color: var(--ink-mute); }
.page-map .search-wrap:focus-within {
  border-color: var(--blood-hot);
  box-shadow: 0 0 0 2px rgba(200, 64, 45, .18);
}
.page-map .search-wrap kbd { color: var(--ink-dim); background: rgba(60, 40, 18, .1); border-color: var(--rule-soft); }

.page-map .region {
  background: #f2dcaa;
  border: 1px solid var(--brass-soft);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .6),
    inset 0 -1px 0 rgba(60, 40, 18, .12);
}
.page-map .region option { background: #f2dcaa; color: var(--ink); }
.page-map .select-arrow { color: var(--ink-dim); }

/* chips */
.page-map .chip-btn {
  background: #f2dcaa;
  border: 1px solid var(--brass-soft);
  color: var(--ink-dim);
}
.page-map .chip-btn:hover {
  color: var(--ink);
  background: #f7e2b2;
  border-color: var(--brass);
}
.page-map .chip-btn.is-active {
  background: linear-gradient(180deg, #f0d29a, #dcbd80);
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .6),
    0 0 0 1px var(--brass),
    0 4px 12px rgba(60, 40, 18, .18);
}
.page-map .chip-count {
  background: rgba(60, 40, 18, .12);
  color: var(--ink-dim);
  border-color: var(--rule-soft);
}
.page-map .chip-btn.is-active .chip-count {
  background: rgba(60, 40, 18, .2);
  color: var(--ink);
  border-color: var(--rule);
}

/* ---------- RANCH LIST CARDS ---------- */
.page-map .ranch-list::-webkit-scrollbar-thumb { background: var(--brass-soft); }
.page-map .ranch {
  background: #f2dcaa;
  border: 1px solid var(--brass-soft);
  box-shadow: 0 2px 6px rgba(60, 40, 18, .08);
}
.page-map .ranch:hover {
  background: #f7e2b2;
  border-color: var(--brass);
  box-shadow: 0 6px 18px rgba(60, 40, 18, .2);
}
.page-map .ranch-name  { color: var(--ink); }
.page-map .ranch-meta  { color: var(--ink-mute); }
.page-map .ranch-meta .sep { color: var(--rule); }

/* sold list-row left rail colors already scoped via category classes — leave them */

.page-map .ranch-price { color: #a84818; }
.page-map .ranch-price small { color: var(--ink-mute); }
.page-map .ranch-price.is-free { color: #2a6a78; }

.page-map .status-sold      { background: rgba(168, 48, 32, .18);  color: #8a2410; border-color: rgba(168, 48, 32, .5); }
.page-map .status-available { background: rgba(62, 122, 42, .18);  color: #3a6a26; border-color: rgba(62, 122, 42, .5); }

.page-map .side-empty p    { color: var(--ink); }
.page-map .side-empty span { color: var(--ink-mute); }
.page-map .side-empty svg  { color: var(--brass-soft); }

/* ---------- MAP STAGE — flat tan matching the map image, no framing vignette ---------- */
.page-map .map-stage { background: #d2b07c; }
.page-map .map-stage::before { background: none; }   /* kill the darkening vignette */
.page-map .map-stage::after  { opacity: 0; }         /* kill the grain on the stage */

.page-map .map-loading {
  background: radial-gradient(60% 40% at 50% 50%, rgba(216, 188, 132, .92), rgba(184, 152, 85, .78));
}
.page-map .map-loading p { color: var(--ink-dim); }
.page-map .loader-ring { border-color: rgba(60, 40, 18, .2); border-top-color: var(--blood-hot); }

/* ---------- FLOATING PANELS (price / legend / controls) ---------- */
.page-map .price-panel,
.page-map .legend,
.page-map .map-controls {
  background:
    linear-gradient(180deg, rgba(244, 220, 168, .95), rgba(220, 188, 128, .95));
  border: 1px solid var(--brass-soft);
  box-shadow:
    0 14px 28px rgba(60, 40, 18, .28),
    inset 0 1px 0 rgba(255, 240, 200, .6),
    inset 0 -1px 0 rgba(60, 40, 18, .15);
  color: var(--ink);
}
.page-map .price-panel::before,
.page-map .legend::before { border-color: var(--rule-soft); }

.page-map .price-panel h3,
.page-map .legend h4 {
  color: #7a3818;
  border-bottom-color: var(--rule);
}
.page-map .price-panel li   { color: var(--ink-dim); }
.page-map .legend-row       { color: var(--ink-dim); }
.page-map .legend-cat       { color: var(--ink); }
.page-map .legend-head      { color: var(--ink-mute); }
.page-map .legend-head-bold { color: #7a3818; }
.page-map .legend-note      { color: var(--ink-mute); border-top-color: var(--rule); }

.page-map .pchip-premium { background: rgba(138, 90, 217, .22); color: #4a2a85; border: 1px solid rgba(138, 90, 217, .5); }
.page-map .pchip-mid     { background: rgba(122, 86, 40, .22);  color: #7a5628; border: 1px solid rgba(122, 86, 40, .6); }
.page-map .pchip-free    { background: rgba(62, 122, 42, .22);  color: #3a6a26; border: 1px solid rgba(62, 122, 42, .55); }

.page-map .map-btn        { color: var(--ink); }
.page-map .map-btn:hover  { background: rgba(200, 64, 45, .18); color: #8a2410; }
.page-map .map-btn + .map-btn { border-top-color: var(--rule-soft); }
.page-map .map-btn-sep    { background: var(--rule-soft); }

/* ---------- PIN TOOLTIP on light map ---------- */
.page-map .pin-tip {
  background: #f2dcaa;
  border: 1px solid var(--brass-soft);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(60, 40, 18, .3);
}
.page-map .pin-tip::after {
  background: #f2dcaa;
  border-right-color: var(--brass-soft);
  border-bottom-color: var(--brass-soft);
}
.page-map .pin-tip b { color: #a84818; }

/* ---------- DETAIL PANEL ---------- */
.page-map .detail {
  background: linear-gradient(180deg, #ecd5a3 0%, #d8bc84 100%);
  border-right: 1px solid var(--brass-soft);
  box-shadow:
    30px 0 60px rgba(60, 40, 18, .45),
    inset -1px 0 0 rgba(60, 40, 18, .2);
}
.page-map .detail::before {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.28   0 0 0 0 0.17   0 0 0 0 0.09   0 0 0 .5 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  opacity: .22;
  mix-blend-mode: multiply;
}
.page-map .detail-close {
  background: rgba(60, 40, 18, .1);
  border-color: var(--brass-soft);
  color: var(--ink-dim);
}
.page-map .detail-close:hover { color: var(--ink); background: rgba(200, 64, 45, .18); border-color: var(--blood-hot); }

.page-map .detail-head h2 {
  color: var(--ink);
  text-shadow: none;
}
.page-map .detail-loc     { color: var(--ink-dim); }
.page-map .detail-loc svg { color: var(--brass); }

/* CRITICAL: give the body a solid cream bg so the title doesn't render
   over the photo's dark bottom-mask gradient (which made it invisible).
   The body still overlaps the photo's last 60px (margin-top: -60px from
   the base rule), but now its cream bg cleanly covers that region. */
.page-map .detail-body {
  background: linear-gradient(180deg,
    rgba(230, 205, 155, .92) 0%,
    var(--panel) 24px,
    var(--panel) 100%);
}

.page-map .detail-cell {
  background: rgba(255, 240, 200, .55);
  border-color: var(--brass-soft);
}
.page-map .detail-label  { color: var(--ink-mute); }
.page-map .detail-cell b { color: var(--ink); }
.page-map .detail-cell .accent { color: #a84818; }
.page-map .detail-desc   { color: var(--ink-dim); }
.page-map .detail-hint   { color: var(--ink-mute); }
.page-map .detail-hint kbd { color: var(--ink-dim); background: rgba(60, 40, 18, .12); border-color: var(--rule-soft); }

.page-map .detail-status.status-sold      { background: rgba(168, 48, 32, .22); color: #8a2410; border: 1px solid rgba(168, 48, 32, .55); }
.page-map .detail-status.status-available { background: rgba(62, 122, 42, .22); color: #3a6a26; border: 1px solid rgba(62, 122, 42, .55); }

.page-map .scrim { background: rgba(60, 40, 18, .35); }

/* ---------- IMAGE-BASED RANCH PHOTOS ---------- */
/* shared quality boost on all ranch images */
.page-map .ranch-thumb img,
.page-map .detail-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1.12) contrast(1.06) brightness(.96);
}

/* small list thumbnails — wrap an image with both a top and bottom gradient
   to mask in-image text + add a subtle inner border */
.page-map .ranch-thumb.has-image { isolation: isolate; }
.page-map .ranch-thumb.has-image::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,.30) 0%, transparent 28%, transparent 60%, rgba(0,0,0,.55) 100%),
    linear-gradient(90deg, rgba(0,0,0,.20) 0%, transparent 18%, transparent 82%, rgba(0,0,0,.20) 100%);
  pointer-events: none;
}
.page-map .ranch-thumb.has-image::after {
  /* keep the inner stroke we already had, but tinted for cream theme */
  box-shadow: inset 0 0 0 1px rgba(60, 40, 18, .35);
}

/* big detail-panel photo — strong top + bottom gradient masks plus a vignette */
.page-map .detail-photo.has-image::after {
  background:
    linear-gradient(180deg,
      rgba(20, 10, 6, .55) 0%,
      rgba(20, 10, 6, .15) 18%,
      transparent 35%,
      transparent 55%,
      rgba(20, 10, 6, .65) 85%,
      rgba(20, 10, 6, .98) 100%),
    radial-gradient(120% 80% at 50% 50%, transparent 55%, rgba(20, 10, 6, .35) 100%);
}
