/* =========================================================
   Saechvo Wild West  ·  Saloon-Ledger redesign
   home + ranches map · supports Georgian + Latin
   ========================================================= */

@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Cinzel+Decorative:wght@700;900&family=Special+Elite&family=Noto+Serif+Georgian:wght@400;500;700;900&family=Noto+Sans+Georgian:wght@400;500;600;700&display=swap");

/* =====================================================
   CSS RESET + VARIABLES
   ===================================================== */
:root {
  /* Tobacco / leather palette */
  --bg-walnut:   #3a2515;
  --paper:       #f0dfb6;

  --ink:         #efdfb8;
  --ink-soft:    #d4be8c;
  --ink-mute:    #8a7655;
  --ink-faint:   #5a4a32;

  --brass:       #c39452;
  --brass-soft:  #8a6a3a;
  --gold:        #f4cf6a;
  --gold-faint:  rgba(195, 148, 82, .25);

  --ember:       #e89149;
  --ember-hot:   #f4b04a;
  --blood-hot:   #d44832;

  --ok:          #6dc278;
  --bad:         #e0563a;

  --rule:        rgba(195, 148, 82, .28);
  --rule-soft:   rgba(195, 148, 82, .12);

  /* Type stacks — Latin display falls back to Georgian when needed */
  --f-display:    "Cinzel", "Noto Serif Georgian", Georgia, serif;
  --f-display-d:  "Cinzel Decorative", "Cinzel", "Noto Serif Georgian", serif;
  --f-serif:      "Noto Serif Georgian", "Cinzel", Georgia, serif;
  --f-mono:       "Special Elite", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;

  /* Layout */
  --nav-h:    72px;
  --topbar-h: 78px;
  --side-w:   400px;
  --maxw:     1320px;
  --r-sm:     6px;
  --r-md:     10px;

  /* Shadows + easing */
  --sh-md:   0 10px 30px rgba(0,0,0,.5);
  --e-out:   cubic-bezier(.2, .7, .1, 1);
  --e-back:  cubic-bezier(.4, 1.4, .6, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
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; padding: 0; }
img { max-width: 100%; display: block; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px solid var(--ember-hot);
  outline-offset: 3px;
  border-radius: 3px;
}

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #4a2210 0%, #1c0e07 38%, #0a0503 90%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--f-serif);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* =====================================================
   AMBIENT FX  (grain · vignette · dust)
   ===================================================== */
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  opacity: .07; 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 .8 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(140% 100% at 50% -10%, transparent 50%, rgba(0,0,0,.55) 100%),
    radial-gradient(80% 60% at 50% 110%, rgba(0,0,0,.6), transparent 70%);
}
.dust {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  overflow: hidden;
}
.dust span {
  position: absolute; bottom: -30px;
  width: 2px; height: 2px; border-radius: 50%;
  background: #f4cf6a;
  box-shadow:
    0 0 6px rgba(244, 207, 106, .65),
    0 0 14px rgba(232, 145, 73, .35);
  opacity: 0;
  animation: dust-rise var(--d, 18s) linear infinite;
  animation-delay: var(--dl, 0s);
}
.dust span:nth-child(1)  { left:  4%; --d: 18s; --dl:  -2s; }
.dust span:nth-child(2)  { left: 12%; --d: 22s; --dl:  -9s; }
.dust span:nth-child(3)  { left: 20%; --d: 16s; --dl:  -4s; }
.dust span:nth-child(4)  { left: 32%; --d: 24s; --dl: -14s; }
.dust span:nth-child(5)  { left: 44%; --d: 19s; --dl:  -7s; }
.dust span:nth-child(6)  { left: 54%; --d: 21s; --dl: -16s; }
.dust span:nth-child(7)  { left: 66%; --d: 17s; --dl:  -3s; }
.dust span:nth-child(8)  { left: 76%; --d: 23s; --dl: -11s; }
.dust span:nth-child(9)  { left: 86%; --d: 20s; --dl:  -6s; }
.dust span:nth-child(10) { left: 94%; --d: 25s; --dl: -18s; }
@keyframes dust-rise {
  0%   { transform: translate(0, 0); opacity: 0; }
  8%   { opacity: .9; }
  90%  { opacity: .7; }
  100% { transform: translate(40px, -110vh); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dust { display: none; }
}

/* =====================================================
   TYPE
   ===================================================== */
h1, h2, h3, h4 { margin: 0; line-height: 1.12; font-weight: 700; }
p { margin: 0 0 1em; }
em { font-style: italic; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--brass);
}
.eyebrow::before, .eyebrow::after {
  content: "";
  width: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}
.eyebrow::after {
  background: linear-gradient(90deg, var(--brass), transparent);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  --btn-bg: var(--bg-walnut);
  --btn-fg: var(--ink);
  --btn-bd: var(--rule);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 24px;
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: .22em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--btn-bg), color-mix(in srgb, var(--btn-bg) 70%, black));
  color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform .25s var(--e-out), border-color .25s ease, box-shadow .25s ease, background .25s ease;
  position: relative;
  isolation: isolate;
}
.btn::after {
  /* brass inner ring */
  content: ""; position: absolute; inset: 1px;
  border-radius: 5px;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(244, 207, 106, .12), inset 0 -1px 0 rgba(0,0,0,.4);
}
.btn:hover  { transform: translateY(-2px); box-shadow: var(--sh-md); }
.btn:active { transform: translateY(0); }

.btn-primary {
  --btn-bg: linear-gradient(180deg, #d44832 0%, #8a1d12 100%);
  --btn-bd: rgba(244, 80, 50, .55);
  background: var(--btn-bg);
  color: #f6efd6;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
  box-shadow: 0 6px 18px rgba(155, 42, 31, .35), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover {
  box-shadow: 0 12px 28px rgba(212, 72, 50, .5), inset 0 1px 0 rgba(255,255,255,.25);
  filter: brightness(1.08);
}

.btn-gold {
  --btn-bg: linear-gradient(180deg, #d4a050 0%, #8a6a3a 100%);
  --btn-bd: rgba(244, 207, 106, .6);
  background: var(--btn-bg);
  color: #1a0c06;
  text-shadow: 0 1px 0 rgba(255,255,255,.18);
  box-shadow: 0 6px 18px rgba(212, 160, 80, .3), inset 0 1px 0 rgba(255,255,255,.3);
  font-weight: 700;
}
.btn-gold:hover {
  box-shadow: 0 12px 28px rgba(244, 207, 106, .42), inset 0 1px 0 rgba(255,255,255,.35);
  filter: brightness(1.08);
}

.btn-ghost {
  background: rgba(34, 18, 8, .5);
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  color: var(--ink); border-color: var(--brass-soft);
  background: rgba(60, 36, 18, .55);
}
.btn-sm { padding: 9px 16px; font-size: 11px; letter-spacing: .18em; }

/* Icon-only button (pure shape) */
.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #2c1a0e, #18100a);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  transition: color .2s ease, border-color .2s ease, transform .2s ease, background .2s ease;
}
.icon-btn:hover {
  color: var(--ember-hot);
  border-color: var(--brass-soft);
  background: linear-gradient(180deg, #3a2516, #20120a);
}

.discord-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #5865f2, #404eed);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 6px 18px rgba(88, 101, 242, .4), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .2s ease, box-shadow .2s ease;
}
.discord-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(88, 101, 242, .55); }

/* =====================================================
   BRAND
   ===================================================== */
.brand {
  display: inline-flex; align-items: center; gap: 14px;
  position: relative;
}
.brand-mark {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #4a2812, #1a0c06 75%);
  box-shadow:
    0 0 0 1px var(--brass-soft),
    0 0 0 4px rgba(195, 148, 82, .12),
    0 6px 18px rgba(0,0,0,.5);
  overflow: hidden;
}
.brand-mark img { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,.5)); }
.brand-text {
  display: inline-flex; flex-direction: column;
  line-height: 1; gap: 6px;
}
.brand-text strong {
  font-family: var(--f-display);
  font-size: 17px; font-weight: 900;
  letter-spacing: .26em;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}
.brand-text em {
  font-style: normal;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .42em;
  color: var(--brass);
  text-transform: uppercase;
}

/* =====================================================
   PAGE: HOME
   ===================================================== */

/* Top nav (sticky, glass) */
.topnav {
  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, 56px);
  transition: background .35s ease, backdrop-filter .35s ease, border-color .35s ease, box-shadow .35s ease;
  border-bottom: 1px solid transparent;
}
.topnav.is-scrolled {
  background: rgba(14, 8, 5, .82);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom-color: var(--rule-soft);
  box-shadow: 0 6px 28px rgba(0,0,0,.5);
}
.topnav-links {
  display: inline-flex; align-items: center; gap: 22px;
}
.topnav-links a:not(.btn) {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-soft);
  padding: 6px 0;
  position: relative;
  transition: color .2s ease;
}
.topnav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--ember-hot);
  transform: scaleX(0); transform-origin: left;
  transition: transform .3s var(--e-out);
}
.topnav-links a:not(.btn):hover { color: var(--ember-hot); }
.topnav-links a:not(.btn):hover::after { transform: scaleX(1); }
@media (max-width: 720px) {
  .topnav-links a:not(.btn) { display: none; }
}

/* Hero */
.hero {
  position: relative; z-index: 2;
  padding: calc(var(--nav-h) + clamp(60px, 12vh, 130px)) 20px clamp(40px, 8vh, 100px);
  text-align: center;
}
.hero-inner {
  max-width: 1080px; margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  margin: 0 auto 20px;
  animation: rise 1s var(--e-out) both;
}
.hero-title {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(54px, 11vw, 156px);
  letter-spacing: .04em;
  line-height: .92;
  color: var(--ink);
  text-transform: uppercase;
  margin: 0;
  text-shadow:
    0 2px 0 rgba(0,0,0,.4),
    0 6px 18px rgba(0,0,0,.55);
  animation: rise 1.1s var(--e-out) .08s both;
}
.hero-title .gold {
  display: block;
  background:
    linear-gradient(180deg, #f8d375 0%, #d4a050 35%, #8a5e2c 75%, #5a3a1a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 12px rgba(212, 160, 80, .35));
  font-family: var(--f-display-d);
}
.hero-title .blood {
  display: block;
  background: linear-gradient(180deg, #f4584a 0%, #c8402d 60%, #6a160c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 14px rgba(200, 64, 45, .3));
}

.hero-divider {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin: 26px auto 28px;
  color: var(--brass);
  animation: rise 1.3s var(--e-out) .18s both;
}
.hero-divider .l, .hero-divider .r {
  flex: 0 0 auto; width: clamp(80px, 14vw, 160px); height: 1px;
  background: linear-gradient(90deg, transparent, var(--brass));
}
.hero-divider .r { background: linear-gradient(90deg, var(--brass), transparent); }
.hero-divider .star {
  width: 30px; height: 30px;
  filter: drop-shadow(0 0 10px rgba(244, 207, 106, .6));
  animation: spin-slow 22s linear infinite;
}
@keyframes spin-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.hero-tagline {
  max-width: 660px; margin: 0 auto 36px;
  font-family: var(--f-serif);
  font-size: clamp(15px, 1.2vw, 18px);
  color: var(--ink-soft);
  animation: rise 1.4s var(--e-out) .26s both;
}

.hero-actions {
  display: inline-flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  animation: rise 1.5s var(--e-out) .34s both;
}

/* Hero stats strip */
.hero-strip {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 20px;
  max-width: 720px; margin: 60px auto 0;
  padding: 22px 28px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background:
    linear-gradient(180deg, rgba(44, 26, 14, .55), rgba(20, 11, 6, .55));
  box-shadow:
    0 18px 44px rgba(0,0,0,.45),
    inset 0 1px 0 rgba(244, 207, 106, .1),
    inset 0 -1px 0 rgba(0,0,0,.45);
  animation: rise 1.6s var(--e-out) .42s both;
}
.hero-strip .cell {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
}
.hero-strip .num {
  font-family: var(--f-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
  line-height: 1;
}
.hero-strip .lbl {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--ink-mute);
}
.hero-strip .sep {
  width: 1px; align-self: stretch;
  background: linear-gradient(180deg, transparent, var(--brass-soft), transparent);
}
@media (max-width: 600px) {
  .hero-strip { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .hero-strip .sep { display: none; }
}

/* Section */
.section {
  position: relative; z-index: 2;
  padding: clamp(50px, 8vh, 90px) clamp(20px, 4vw, 56px);
  max-width: var(--maxw); margin: 0 auto;
}
.section-head {
  text-align: center;
  margin-bottom: clamp(36px, 5vh, 56px);
}
.section-eyebrow { margin-bottom: 14px; }
.section-title {
  font-family: var(--f-display);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}
.section-sub {
  max-width: 580px; margin: 0 auto;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.05vw, 16px);
}

/* WANTED-poster cards */
.posters {
  display: grid; gap: 26px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px) { .posters { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .posters { grid-template-columns: 1fr; } }

.poster {
  --accent: var(--ember);
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s ease, transform .8s var(--e-out);
}
.poster.is-in { opacity: 1; transform: none; }

.poster-inner {
  display: block; position: relative;
  border-radius: var(--r-md);
  background:
    linear-gradient(180deg, #2c1a0e 0%, #1a0e08 100%);
  border: 1px solid var(--rule-soft);
  box-shadow:
    0 16px 36px rgba(0,0,0,.5),
    inset 0 1px 0 rgba(244, 207, 106, .07);
  overflow: hidden;
  isolation: isolate;
  transition: transform .45s var(--e-out), border-color .35s ease, box-shadow .45s ease;
  aspect-ratio: 4 / 5;
}
.poster-inner:hover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--accent) 60%, var(--rule));
  box-shadow:
    0 26px 60px rgba(0,0,0,.6),
    0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent),
    0 0 28px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* parchment top portion */
.poster-tag {
  position: absolute; top: 12px; left: 14px; z-index: 5;
  font-family: var(--f-mono);
  font-size: 9.5px; letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--brass);
  background: rgba(14, 8, 5, .75);
  padding: 4px 9px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  backdrop-filter: blur(4px);
}
.poster-no {
  position: absolute; top: 12px; right: 14px; z-index: 5;
  font-family: var(--f-display);
  font-size: 14px; font-weight: 900;
  color: var(--ink-faint);
  letter-spacing: .1em;
}

.poster-art {
  position: absolute; inset: 0;
  display: block;
}
.poster-art svg {
  width: 100%; height: 60%;
  display: block;
  transform: scale(1.04);
  transition: transform .8s var(--e-out), filter .8s ease;
  filter: saturate(.95) contrast(1.05) brightness(.95);
}
.poster-inner:hover .poster-art svg { transform: scale(1.1); filter: saturate(1.05) contrast(1.1); }
.poster-art::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(13, 6, 4, .65) 50%, rgba(13, 6, 4, .98) 100%);
}

.poster-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 22px 24px;
  z-index: 3;
}
.poster-body h3 {
  font-family: var(--f-display);
  font-size: clamp(19px, 1.7vw, 26px);
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 8px;
  text-shadow: 0 2px 8px rgba(0,0,0,.7);
  transition: color .3s ease;
}
.poster-inner:hover .poster-body h3 { color: var(--ember-hot); }
.poster-body p {
  font-family: var(--f-serif);
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.poster-cta {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 10.5px; letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ember-hot);
  transition: gap .3s var(--e-out);
}
.poster-cta::after {
  content: "→";
  display: inline-block; font-family: serif;
  transition: transform .3s var(--e-out);
}
.poster-inner:hover .poster-cta { gap: 12px; }
.poster-inner:hover .poster-cta::after { transform: translateX(4px); }

/* accent bar at bottom */
.poster-inner::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: .45;
  transition: opacity .3s ease, height .3s ease;
}
.poster-inner:hover::after { opacity: 1; height: 4px; }

/* "Coming soon" tag for unfinished cards */
.poster.coming .poster-inner {
  opacity: .7;
  filter: grayscale(.4);
}
.poster.coming .poster-inner::before {
  content: "მალე"; position: absolute; top: 14px; right: 14px; z-index: 6;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .25em;
  text-transform: uppercase; color: var(--ember-hot);
  background: rgba(14, 8, 5, .8); border: 1px solid var(--rule);
  padding: 4px 9px; border-radius: 3px;
}
.poster.coming .poster-no { display: none; }

/* Footer */
.foot {
  position: relative; z-index: 2;
  padding: 28px clamp(20px, 4vw, 56px) 36px;
  border-top: 1px solid var(--rule-soft);
  display: flex; flex-wrap: wrap; gap: 16px;
  justify-content: space-between; align-items: center;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: rgba(14, 8, 5, .35);
}
.foot a { color: var(--ink-soft); transition: color .2s ease; }
.foot a:hover { color: var(--ember-hot); }

/* universal animations */
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================
   PAGE: RANCHES MAP
   ===================================================== */
.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: auto 1fr auto;
  align-items: center;
  padding: 0 clamp(16px, 2.5vw, 32px);
  gap: 24px;
  background:
    linear-gradient(180deg, #261409 0%, #170c06 60%, #0a0503 100%);
  border-bottom: 1px solid var(--brass-soft);
  box-shadow:
    0 6px 26px rgba(0,0,0,.65),
    inset 0 -1px 0 rgba(0,0,0,.6),
    inset 0 1px 0 rgba(244, 207, 106, .08);
  isolation: isolate;
}
/* leather grain texture */
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  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 .28 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  mix-blend-mode: overlay;
  opacity: .8;
}
.topbar > * { position: relative; z-index: 1; }
/* blood strip on top */
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, #6b1a10, var(--blood-hot) 50%, #6b1a10);
  box-shadow: 0 1px 6px rgba(212, 72, 50, .5);
  z-index: 2;
}
.brand-lg .brand-text strong { font-size: 16px; letter-spacing: .24em; }
.brand-lg .brand-text em {
  font-family: var(--f-serif); font-style: italic; text-transform: none;
  letter-spacing: .04em; font-size: 11.5px; color: var(--ink-mute); font-weight: 400;
}

.stats {
  justify-self: center;
  display: inline-flex; gap: 28px;
  padding: 10px 24px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background:
    linear-gradient(180deg, rgba(44, 26, 14, .7), rgba(14, 7, 4, .7));
  box-shadow:
    inset 0 1px 0 rgba(244, 207, 106, .12),
    inset 0 -1px 0 rgba(0,0,0,.55);
}
.stat { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat b {
  font-family: var(--f-display); font-weight: 900;
  font-size: 22px; line-height: 1; color: var(--ink);
}
.stat span {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .26em;
  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; }

@media (max-width: 980px) {
  .topbar { grid-template-columns: auto auto; gap: 12px; padding: 0 16px; }
  .stats { display: none; }
}
@media (max-width: 480px) {
  .brand-text em { display: none; }
}

/* App shell */
.app {
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
}
@media (max-width: 1024px) {
  :root { --side-w: 100%; }
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    overflow: hidden;
  }
  .side {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 62px;
    min-height: 62px;
    max-height: min(72vh, 560px);
    overflow: hidden;
    overflow: clip;
    transition: height .35s var(--e-out), box-shadow .35s ease;
    border-left: 0 !important;
    border-top: 1px solid var(--rule);
    z-index: 30;
  }
  .side.is-open {
    height: min(72vh, 560px);
    box-shadow: 0 -20px 44px rgba(0,0,0,.65);
  }
  .side-top {
    min-height: 44px;
    align-items: center;
  }
  .side-head {
    padding: 10px 14px 12px;
    gap: 10px;
  }
  .side-toggle { width: 100%; justify-content: flex-start; }
  .side:not(.is-open) .side-toggle-ico { transform: rotate(180deg); }
  .side.is-open .side-toggle-ico { color: var(--ember-hot); }
  .side:not(.is-open) .search-wrap,
  .side:not(.is-open) .chips,
  .side:not(.is-open) .select-wrap,
  .side:not(.is-open) .ranch-list,
  .side:not(.is-open) .side-empty {
    opacity: 0;
    pointer-events: none;
  }
  .side:not(.is-open) .side-head { border-bottom-color: transparent; }
}

/* ====== MAP STAGE ======
   NOTE: do NOT set `isolation: isolate` (or any property that creates a
   stacking context) on .map-stage. The .map-card popover lives inside
   this element and needs to be able to rise above the topbar
   (z-index: 50 at body level). A stacking context here would trap it
   below the topbar no matter how high its internal z-index is. */
.map-stage {
  position: relative;
  /* matches the cream of map.jpg's natural padding so the stage blends in */
  background: #d4b891;
  overflow: hidden;
}
/* (no vignette — keep the cream flat so it matches the map padding) */

.map-loading {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  background: radial-gradient(60% 50% at 50% 50%, #1a0e08 0%, #0a0503 100%);
  transition: opacity .5s ease, visibility .5s ease;
}
.map-loading.is-done { opacity: 0; visibility: hidden; }
.map-loading .loader-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--rule);
  border-top-color: var(--ember-hot);
  margin: 0 auto 14px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.map-loading p {
  margin: 0; text-align: center;
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-soft);
}

.map-viewport {
  position: absolute; inset: 0;
  cursor: grab;
  touch-action: none;
  overflow: hidden;
  z-index: 1;
}
.map-viewport.is-dragging { cursor: grabbing; }
.map-canvas {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.map-img {
  display: block;
  width: 100%; height: 100%;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  /* No filter — map.jpg's natural cream is #d3b790, already matches stage */
}

.pins { position: absolute; inset: 0; }

/* PIN */
.pin {
  position: absolute;
  width: 0; height: 0;
  z-index: 4;
  --inv-scale: 1;
}
.pin-inner {
  position: absolute;
  left: 0; top: 0;
  width: 44px; height: 56px;
  transform: translate(-50%, -100%) scale(var(--inv-scale));
  transform-origin: 50% 100%;
  filter: drop-shadow(0 4px 7px rgba(0,0,0,.7));
  cursor: pointer;
  transition: transform .25s var(--e-back);
  animation: pin-drop .55s var(--e-back) var(--pin-delay, 0ms) both;
}
@keyframes pin-drop {
  0%   { transform: translate(-50%, -180%) scale(calc(var(--inv-scale) * 1.2)); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translate(-50%, -100%) scale(var(--inv-scale)); opacity: 1; }
}
.pin:hover { z-index: 10; }
.pin:hover .pin-inner {
  transform: translate(-50%, -100%) scale(calc(var(--inv-scale) * 1.18));
}
.pin.is-active { z-index: 11; }
.pin.is-active .pin-inner {
  transform: translate(-50%, -100%) scale(calc(var(--inv-scale) * 1.25));
  filter: drop-shadow(0 6px 10px rgba(244, 176, 74, .5));
}

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

.pin-farm  .pin-bg { fill: #e8b53a; stroke: #2a1808; stroke-width: 1.4; }
.pin-farm.is-sold  .pin-bg { fill: #6a4a14; 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: #5a160c; 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; }
.pin.is-sold .pin-inner { filter: drop-shadow(0 5px 8px rgba(0,0,0,.75)); }

/* tip */
.pin-tip {
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  font-family: var(--f-mono);
  font-size: 13px; letter-spacing: .04em;
  color: var(--paper);
  background: rgba(20, 11, 6, .96);
  border: 1px solid var(--brass);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  box-shadow: 0 8px 22px rgba(0,0,0,.65);
}
.pin-tip::after {
  content: ""; position: absolute; left: 50%; bottom: -5px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px;
  background: rgba(20, 11, 6, .96);
  border-right: 1px solid var(--brass-soft);
  border-bottom: 1px solid var(--brass-soft);
}
.pin:hover .pin-tip { opacity: 1; }
/* hide hover label on the selected pin — the popover card already shows it */
.pin.is-active .pin-tip { opacity: 0; }
.pin-tip b { color: var(--ember-hot); font-weight: 700; }

/* Map controls */
.map-controls {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
  padding: 6px;
  background: rgba(20, 11, 6, .82);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(0,0,0,.5);
}
.map-btn {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  background: linear-gradient(180deg, rgba(60, 36, 18, .5), rgba(20, 11, 6, .5));
  border: 1px solid var(--rule-soft);
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.map-btn:hover {
  color: var(--ember-hot);
  border-color: var(--brass-soft);
  background: linear-gradient(180deg, rgba(80, 48, 24, .65), rgba(28, 16, 10, .65));
}
.map-btn-sep { height: 1px; background: var(--rule); margin: 2px 0; }
.map-btn .ico-full-out { display: none; }
.map-stage.is-fullscreen .map-btn .ico-full-in  { display: none; }
.map-stage.is-fullscreen .map-btn .ico-full-out { display: block; }

/* Price panel (bottom-left) */
.price-panel {
  position: absolute; bottom: 16px; left: 16px; z-index: 5;
  width: 240px;
  padding: 14px 16px;
  background: rgba(20, 11, 6, .92);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0,0,0,.55);
  font-family: var(--f-serif);
}
.price-panel h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--f-display);
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}
.price-panel ul { display: flex; flex-direction: column; gap: 7px; }
.price-panel li {
  display: grid; grid-template-columns: auto 1fr;
  gap: 10px; align-items: center;
  font-size: 12px; color: var(--ink-soft);
}
.pchip {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em;
  font-weight: 700;
  padding: 4px 8px; border-radius: 3px;
  border: 1px solid;
  min-width: 60px;
}
.pchip-premium { color: #b89cf0; border-color: rgba(169, 134, 224, .55); background: rgba(169, 134, 224, .12); }
.pchip-mid     { color: #f4cf6a; border-color: rgba(244, 207, 106, .55); background: rgba(244, 207, 106, .12); }
.pchip-free    { color: #6dc278; border-color: rgba(109, 194, 120, .55); background: rgba(109, 194, 120, .12); }

/* Legend (bottom-right) */
.legend {
  position: absolute; bottom: 16px; right: 16px; z-index: 5;
  width: 200px;
  padding: 14px 16px;
  background: rgba(20, 11, 6, .92);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 16px 36px rgba(0,0,0,.55);
}
.legend h4 {
  font-family: var(--f-display);
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 10px;
}
.legend-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px 14px;
  align-items: center;
  justify-items: center;
}
.legend-grid .legend-cat { justify-self: start; }
.legend-head {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-mute);
  text-align: center;
}
.legend-cat {
  font-family: var(--f-serif); font-size: 12.5px;
  color: var(--ink-soft);
}
.dot {
  display: inline-block; width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid #2a1808;
  box-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.dot-farm  { background: #e8b53a; }
.dot-ranch { background: #d74e3a; border-color: #2a0a05; }
.dot-house { background: #58b5c9; border-color: #06222a; }
.dot.is-sold {
  border-width: 3px; border-color: #000;
}
.dot-farm.is-sold  { background: #6a4a14; }
.dot-ranch.is-sold { background: #5a160c; }
.dot-house.is-sold { background: #1a4a58; }
.legend-note {
  margin: 10px 0 0;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--ink-mute);
}

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

/* ====== SIDEBAR ====== */
.side {
  display: flex; flex-direction: column;
  background:
    linear-gradient(180deg, #261409 0%, #170c06 55%, #0c0503 100%);
  border-left: 1px solid var(--brass-soft);
  box-shadow:
    -24px 0 50px rgba(0,0,0,.55),
    inset 1px 0 0 rgba(244, 207, 106, .1),
    inset 0 1px 0 rgba(244, 207, 106, .07);
  min-height: 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
}
/* leather grain */
.side::before {
  content: ""; position: absolute; inset: 0; 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 .8' numOctaves='2' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 .22 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  mix-blend-mode: overlay;
  opacity: .55;
}
.side > * { position: relative; z-index: 1; }

.side-head {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; gap: 14px;
}
.side-top {
  display: flex; align-items: baseline; justify-content: space-between;
}
.side-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  width: auto;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  margin: 0;
}
.side-title {
  font-family: var(--f-display);
  font-size: 16px; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
}
.side-toggle-ico {
  width: 12px;
  height: 8px;
  color: var(--ink-mute);
  transition: transform .25s var(--e-out), color .2s ease;
}
.side-count {
  font-family: var(--f-mono);
  font-size: 11px; letter-spacing: .15em;
  padding: 3px 10px;
  background: rgba(244, 207, 106, .14);
  color: var(--gold);
  border: 1px solid var(--gold-faint);
  border-radius: 3px;
}

/* Search */
.search-wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 8px 12px;
  background: rgba(8, 4, 2, .55);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  transition: border-color .25s ease, background .25s ease;
}
.search-wrap:focus-within {
  border-color: var(--brass-soft);
  background: rgba(8, 4, 2, .8);
}
.search-wrap svg { color: var(--ink-mute); flex-shrink: 0; }
.search-wrap input {
  border: 0; background: transparent; outline: none;
  font-family: var(--f-serif); font-size: 14px;
  color: var(--ink); width: 100%; padding: 4px 0;
}
.search-wrap input::placeholder { color: var(--ink-mute); font-style: italic; }
.search-wrap kbd {
  font-family: var(--f-mono); font-size: 10px;
  padding: 1px 6px; border-radius: 3px;
  background: rgba(244, 207, 106, .1);
  border: 1px solid var(--rule-soft);
  color: var(--ink-mute);
}

/* Filter chips */
.chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 11px;
  background: rgba(34, 18, 8, .5);
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-sm);
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .2s ease;
}
.chip-btn:hover {
  border-color: var(--brass-soft);
  color: var(--ink);
}
.chip-btn.is-active {
  background: linear-gradient(180deg, #3a2515, #20130a);
  border-color: var(--brass);
  color: var(--ember-hot);
  box-shadow: 0 0 0 1px rgba(244, 207, 106, .15), inset 0 1px 0 rgba(244, 207, 106, .12);
}
.chip-btn .dot { width: 8px; height: 8px; border-width: 1.5px; }
.chip-count {
  font-family: var(--f-mono); font-weight: 700;
  font-size: 10px; padding: 1px 5px;
  background: rgba(0,0,0,.4); border-radius: 3px;
  color: var(--ink-mute);
  min-width: 18px; text-align: center;
}
.chip-btn.is-active .chip-count { color: var(--gold); background: rgba(244, 207, 106, .12); }

/* Region select */
.select-wrap {
  position: relative;
  display: block;
}
.select-wrap .region {
  appearance: none; -webkit-appearance: none;
  width: 100%;
  padding: 9px 36px 9px 14px;
  background: rgba(8, 4, 2, .55);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-family: var(--f-serif); font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .2s ease;
}
.select-wrap .region:hover,
.select-wrap .region:focus { border-color: var(--brass-soft); outline: none; }
.select-arrow {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  width: 11px; height: 8px;
  color: var(--ink-mute);
  pointer-events: none;
}
.select-wrap .region option {
  background: #1a0e08; color: var(--ink);
}

/* Property list */
.ranch-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 14px 14px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--brass-soft) transparent;
}
.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;
}
.ranch-list::-webkit-scrollbar-thumb:hover { background: var(--brass); }

.ranch {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px; align-items: center;
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(44, 26, 14, .35), rgba(20, 11, 6, .55));
  border: 1px solid var(--rule-soft);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform .25s var(--e-out), border-color .25s ease, background .25s ease, box-shadow .25s ease;
  opacity: 0;
  animation: slide-in .45s var(--e-out) forwards;
  position: relative;
  isolation: isolate;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: none; }
}
.ranch:hover {
  border-color: var(--brass-soft);
  background:
    linear-gradient(180deg, rgba(60, 36, 18, .55), rgba(28, 16, 10, .65));
  transform: translateX(-3px);
  box-shadow: -4px 0 0 var(--ember-hot), 0 8px 18px rgba(0,0,0,.4);
}
.ranch:focus-visible { outline: 2px solid var(--ember-hot); outline-offset: 2px; }
.ranch.is-active {
  border-color: var(--brass);
  background:
    linear-gradient(180deg, rgba(74, 44, 22, .65), rgba(34, 20, 12, .75));
  box-shadow: -4px 0 0 var(--ember-hot), 0 8px 22px rgba(0,0,0,.5);
}
.ranch.is-sold { opacity: .65; }

.ranch-thumb {
  width: 64px; height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--rule);
  position: relative;
  background: #0a0503;
  flex-shrink: 0;
}
.ranch-thumb img { width: 100%; height: 100%; object-fit: cover; filter: sepia(.18) saturate(.9); }
.ranch-thumb svg { width: 100%; height: 100%; }
.thumb-badge {
  position: absolute; bottom: 4px; right: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid #1a0c06;
  box-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.badge-farm  { background: #e8b53a; }
.badge-ranch { background: #d74e3a; }
.badge-house { background: #58b5c9; }
.thumb-badge.is-sold { background: #000; }

.ranch-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ranch-name {
  font-family: var(--f-serif); font-weight: 700; font-size: 14.5px;
  color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ranch-meta {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em;
  color: var(--ink-mute);
}
.ranch-loc {
  display: inline-flex; align-items: center; gap: 4px;
}
.ranch-loc svg { width: 11px; height: 11px; }
.ranch-meta .sep { opacity: .6; }
.ranch-meta .type {
  font-weight: 700; letter-spacing: .15em;
  padding: 1px 5px; border-radius: 3px;
}
.type-farm  { color: #e8b53a; background: rgba(232, 181, 58, .1); }
.type-ranch { color: #e87060; background: rgba(215, 78, 58, .12); }
.type-house { color: #7ad0e2; background: rgba(88, 181, 201, .12); }

.ranch-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.ranch-price {
  font-family: var(--f-display); font-weight: 700;
  font-size: 16px; color: var(--gold);
  line-height: 1;
}
.ranch-price small {
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 400;
  letter-spacing: .15em; color: var(--ink-mute); margin-left: 2px;
}
.ranch-price.is-free {
  color: var(--ok);
}
.status-pill {
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: .15em;
  padding: 2px 6px; border-radius: 3px;
  text-transform: uppercase; font-weight: 700;
  border: 1px solid;
}
.status-available { color: var(--ok); border-color: rgba(109, 194, 120, .5); background: rgba(109, 194, 120, .1); }
.status-sold      { color: var(--bad); border-color: rgba(224, 86, 58, .5); background: rgba(224, 86, 58, .1); }

/* Empty state */
.side-empty {
  flex: 1 1 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 40px 24px;
  color: var(--ink-mute);
  text-align: center;
}
.side-empty[hidden] { display: none; }
.side-empty svg { color: var(--ink-faint); }
.side-empty p { margin: 0; font-family: var(--f-display); font-size: 16px; color: var(--ink-soft); }
.side-empty span { font-family: var(--f-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }

/* ====== ON-MAP PROPERTY CARD ======
   A compact popover anchored to the selected pin, like the small
   info-card a player would see when tapping a marker on a game map.
   Identical design on PC and mobile; positioned via JS based on
   the active pin's screen-space coordinates. */
.map-card {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(280px, 86vw, 340px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, #2c1810 0%, #170c06 100%);
  border: 1px solid var(--brass-soft);
  border-radius: 14px;
  box-shadow:
    0 22px 50px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(0, 0, 0, .4),
    inset 0 1px 0 rgba(244, 207, 106, .12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.96);
  transform-origin: 50% 100%;
  transition: opacity .22s ease, transform .32s var(--e-back), visibility .22s ease;
  pointer-events: auto;
  isolation: isolate;
}
.map-card.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.map-card[data-placement="below"] { transform-origin: 50% 0; }
.map-card[data-placement="below"]:not(.is-open) { transform: translateY(-8px) scale(.96); }

/* leather grain subtle texture */
.map-card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  border-radius: inherit;
  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 .8' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.4  0 0 0 0 0.22  0 0 0 0 0.10  0 0 0 .18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
  mix-blend-mode: overlay;
  opacity: .45;
  z-index: 0;
}
.map-card > * { position: relative; z-index: 1; }

.map-card-close {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: rgba(20, 11, 6, .85);
  border: 1px solid var(--brass-soft);
  border-radius: 50%;
  color: var(--ink);
  z-index: 3;
  cursor: pointer;
  transition: color .2s ease, border-color .2s ease, transform .25s var(--e-out), background .2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
}
.map-card-close:hover,
.map-card-close:focus-visible {
  color: var(--ember-hot);
  border-color: var(--ember-hot);
  background: rgba(40, 22, 12, .95);
  transform: rotate(90deg);
}

.map-card-photo {
  height: 160px;
  border-radius: 13px 13px 0 0;
  overflow: hidden;
  background: #1a0e08;
  position: relative;
  flex-shrink: 0;
}
.map-card-photo img,
.map-card-photo svg {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(.12) saturate(.95) contrast(1.05);
}
.map-card-photo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  background: linear-gradient(180deg, transparent, rgba(20, 11, 6, .65));
  pointer-events: none;
}

.map-card-body {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-card-status {
  align-self: flex-start;
  font-family: var(--f-mono);
  font-size: 9.5px;
  letter-spacing: .26em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 3px;
  border: 1px solid;
}
.map-card-status.status-available {
  color: var(--ok);
  border-color: rgba(109, 194, 120, .55);
  background: rgba(109, 194, 120, .12);
}
.map-card-status.status-sold {
  color: var(--bad);
  border-color: rgba(224, 86, 58, .55);
  background: rgba(224, 86, 58, .12);
}

.map-card-name {
  font-family: var(--f-display);
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0;
  line-height: 1.08;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}

.map-card-loc {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.map-card-loc-pin {
  display: inline-block;
  width: 10px; height: 14px;
  position: relative;
  flex-shrink: 0;
  background: var(--ember);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.map-card-loc-pin::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .35);
}
.map-card[data-type="farm"]  .map-card-loc-pin { background: #e8b53a; }
.map-card[data-type="ranch"] .map-card-loc-pin { background: #d74e3a; }
.map-card[data-type="house"] .map-card-loc-pin { background: #58b5c9; }

.map-card-loc-players {
  margin-left: 6px;
  color: var(--ink-mute);
  letter-spacing: .14em;
}
.map-card-loc-players::before {
  content: "·";
  margin-right: 6px;
  color: var(--brass-soft);
}

.map-card-price {
  font-family: var(--f-display);
  font-size: clamp(20px, 1.8vw, 24px);
  font-weight: 900;
  color: var(--gold);
  line-height: 1.05;
  margin: 2px 0 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}
.map-card-price small {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-mute);
  letter-spacing: .15em;
  margin-left: 6px;
}
.map-card-price.is-free { color: var(--ok); }

.map-card-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
  padding: 12px 18px;
  background: linear-gradient(180deg, #d4a050 0%, #8a6a3a 100%);
  color: #1a0c06;
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid rgba(244, 207, 106, .55);
  box-shadow:
    0 6px 14px rgba(212, 160, 80, .25),
    inset 0 1px 0 rgba(255, 255, 255, .35);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.map-card-cta:hover {
  transform: translateY(-1px);
  box-shadow:
    0 10px 22px rgba(244, 207, 106, .4),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  filter: brightness(1.06);
}

/* tail pointing toward the active pin; X position set by JS via --tail-x */
.map-card-tail {
  position: absolute;
  left: var(--tail-x, 50%);
  bottom: -7px;
  width: 14px; height: 14px;
  background: #170c06;
  border-right: 1px solid var(--brass-soft);
  border-bottom: 1px solid var(--brass-soft);
  transform: translateX(-50%) rotate(45deg);
  z-index: 0;
  pointer-events: none;
}
.map-card[data-placement="below"] .map-card-tail {
  bottom: auto;
  top: -7px;
  background: #2c1810;
  border-right: 0;
  border-bottom: 0;
  border-top: 1px solid var(--brass-soft);
  border-left: 1px solid var(--brass-soft);
}
.map-card[data-placement="center"] .map-card-tail { display: none; }

/* fullscreen state */
.map-stage.is-fullscreen .price-panel,
.map-stage.is-fullscreen .legend {
  background: rgba(0, 0, 0, .8);
}

@media (max-width: 600px) {
  .map-card-photo { height: 130px; }
  .map-card-body { padding: 12px 16px 14px; gap: 7px; }
}

/* Mobile sidebar sheet overrides (must stay at file end to win cascade) */
@media (max-width: 1024px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    position: relative;
    overflow: hidden;
  }
  .app > .map-stage {
    min-height: 0;
    height: 100%;
  }
  .app > .side {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    min-height: 62px;
    max-height: min(72vh, 560px);
    /* `clip` instead of `hidden` so the box is NOT a scroll container.
       With `hidden`, scrollIntoView() on a child .ranch silently scrolls
       the side by ~180px, which lifts the toggle off-screen and makes
       the collapsed tab look empty (the reported "tab disappears" bug). */
    overflow: hidden;
    overflow: clip;
    z-index: 30;
    border-left: 0 !important;
    border-top: 1px solid var(--rule);
    transition: height .35s var(--e-out), box-shadow .35s ease;
  }
  .app > .side.is-open {
    height: min(72vh, 560px);
    box-shadow: 0 -20px 44px rgba(0,0,0,.65);
  }
  .app > .side .side-top {
    min-height: 44px;
    align-items: center;
  }
  .app > .side .side-head {
    padding: 10px 14px 12px;
    gap: 10px;
  }
  .app > .side .side-toggle {
    width: 100%;
    justify-content: flex-start;
  }
  .app > .side:not(.is-open) .side-toggle-ico { transform: rotate(180deg); }
  .app > .side.is-open .side-toggle-ico { color: var(--ember-hot); }
  .app > .side:not(.is-open) .search-wrap,
  .app > .side:not(.is-open) .chips,
  .app > .side:not(.is-open) .select-wrap,
  .app > .side:not(.is-open) .ranch-list,
  .app > .side:not(.is-open) .side-empty {
    opacity: 0;
    pointer-events: none;
  }
  .app > .side:not(.is-open) .side-head { border-bottom-color: transparent; }
}
