/* ── House Hunt — synthwave neon, dark-only ─────────────────────────── */
:root {
  color-scheme: dark;
  --page: #07070f;
  --surface-1: #0b0b16;
  --surface-2: #11101f;
  --text-primary: #f4f2ff;
  --text-secondary: #b9b5d0;
  --muted: #817d9c;
  --hairline: rgba(255, 255, 255, 0.09);
  --grid: #201f33;

  /* validated data-mark palette (dark surface #0b0b16) */
  --series-pink: #e02c8d;
  --series-cyan: #009cb0;
  --series-violet: #8f6ee8;
  --series-gold: #b08900;

  /* hot neons — decorative glow only, never a data encoding */
  --glow-pink: #ff3da6;
  --glow-cyan: #22d9ee;
  --glow-violet: #a78bfa;

  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;

  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.55;
}

a { color: var(--glow-cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── hero ── */
header.hero {
  padding: 44px 0 10px;
  text-align: center;
}
header.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(100deg, var(--glow-pink), var(--glow-violet) 55%, var(--glow-cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px rgba(255, 61, 166, 0.35));
}
header.hero p.sub {
  color: var(--text-secondary);
  margin: 10px auto 0;
  max-width: 640px;
}
.secref { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; }

/* ── map ── */
#map-section { margin-top: 28px; }
#map {
  height: min(62vh, 560px);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-1);
}
.leaflet-container { background: #0a0a13; font: inherit; }
.leaflet-control-attribution {
  background: rgba(7, 7, 15, 0.7) !important;
  color: var(--muted) !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }

.pin {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--series-cyan);
  box-shadow: 0 0 10px 2px rgba(34, 217, 238, 0.65);
}
.pin.frontrunner {
  background: var(--series-pink);
  box-shadow: 0 0 12px 3px rgba(255, 61, 166, 0.75);
}
.pin-label {
  background: rgba(11, 11, 22, 0.92);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  white-space: nowrap;
  box-shadow: none;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--hairline);
}
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content b { font-size: 0.95rem; }
.leaflet-popup-content .mini { color: var(--text-secondary); font-size: 0.8rem; }

/* ── cards grid ── */
section.block { padding: 44px 0 8px; }
section.block h2 {
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
}
section.block p.lede { color: var(--text-secondary); margin: 4px 0 24px; max-width: 720px; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 18px 18px 14px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.card:hover {
  border-color: rgba(34, 217, 238, 0.45);
  transform: translateY(-2px);
}
.card.frontrunner { border-color: rgba(255, 61, 166, 0.5); }
.card.frontrunner:hover { border-color: rgba(255, 61, 166, 0.8); }
.card .tag {
  position: absolute; top: 14px; right: 14px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.1em;
  color: var(--glow-pink);
  border: 1px solid rgba(255, 61, 166, 0.4);
  border-radius: 999px;
  padding: 2px 9px;
}
.card h3 { margin: 0 0 2px; font-size: 1.08rem; }
.card .hid { color: var(--muted); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; }
.card .meta { color: var(--text-secondary); font-size: 0.85rem; margin: 6px 0 10px; }
.card .scoreline { display: flex; align-items: center; gap: 10px; }
.scorebar {
  flex: 1; height: 6px; border-radius: 3px;
  background: var(--grid);
  overflow: hidden;
}
.scorebar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--series-violet), var(--series-pink));
  border-radius: 3px;
}
.scoreval { font-weight: 700; font-size: 0.9rem; min-width: 3.4em; text-align: right; }

/* ── detail panel ── */
#detail-backdrop {
  position: fixed; inset: 0;
  background: rgba(4, 4, 10, 0.72);
  backdrop-filter: blur(3px);
  z-index: 900;
  display: none;
}
#detail {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(680px, 100vw);
  background: var(--surface-2);
  border-left: 1px solid var(--hairline);
  z-index: 1000;
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform 0.22s ease;
  padding: 28px 30px 40px;
}
#detail.open { transform: translateX(0); }
#detail .close {
  position: sticky; top: 0; float: right;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  color: var(--text-secondary);
  border-radius: 8px;
  font-size: 1rem;
  padding: 4px 12px;
  cursor: pointer;
}
#detail h2 { margin: 6px 0 0; font-size: 1.5rem; }
#detail .hid { color: var(--muted); font-weight: 700; letter-spacing: 0.08em; font-size: 0.8rem; }
#detail .price { color: var(--glow-cyan); font-weight: 700; font-size: 1.15rem; margin: 4px 0 0; }
#detail .status-note { color: var(--text-secondary); font-size: 0.85rem; }
#detail .facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 18px 0 6px;
}
#detail .fact {
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 9px 12px;
}
#detail .fact .k { color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em; }
#detail .fact .v { font-weight: 650; font-size: 0.93rem; margin-top: 2px; }
#detail .blurb { color: var(--text-secondary); font-size: 0.92rem; margin: 14px 0 0; }
#detail h4 { margin: 26px 0 10px; font-size: 1.02rem; letter-spacing: 0.02em; }
#detail .links { margin-top: 20px; font-size: 0.88rem; }
#detail .links a { margin-right: 16px; }

/* criteria meters */
.crit { margin-bottom: 13px; }
.crit .row1 {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px;
}
.crit .cname { font-weight: 600; font-size: 0.9rem; }
.crit .cid { color: var(--muted); font-size: 0.72rem; font-weight: 700; margin-right: 6px; }
.crit .cscore { font-weight: 700; font-size: 0.85rem; }
.crit .meter {
  height: 7px; border-radius: 4px; background: var(--grid);
  margin: 5px 0 4px; overflow: hidden;
}
.crit .meter > i {
  display: block; height: 100%; border-radius: 4px;
  background: var(--series-cyan);
}
.crit.s5 .meter > i, .crit.s4 .meter > i { background: var(--series-cyan); }
.crit.s0 .meter > i, .crit.s1 .meter > i { background: var(--status-critical); }
.crit .cnote { color: var(--text-secondary); font-size: 0.82rem; }

/* ── compare matrix ── */
.matrix-scroller { overflow-x: auto; border: 1px solid var(--hairline); border-radius: 12px; }
table.matrix {
  border-collapse: collapse;
  width: 100%;
  min-width: 860px;
  background: var(--surface-1);
  font-size: 0.82rem;
}
.matrix th, .matrix td {
  padding: 9px 10px;
  text-align: center;
  border-bottom: 1px solid var(--grid);
}
.matrix th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.matrix td.house {
  text-align: left; font-weight: 650; color: var(--text-primary);
  white-space: nowrap; cursor: pointer;
}
.matrix td.house:hover { color: var(--glow-cyan); }
.matrix td.total { font-weight: 750; }
.cell {
  display: inline-block; min-width: 2em;
  border-radius: 6px; padding: 2px 6px;
  font-weight: 650; color: #fff;
}

footer {
  margin-top: 56px;
  border-top: 1px solid var(--hairline);
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.8rem;
}
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ── v2: photo cards ── */
.card { padding: 0; overflow: hidden; }
.cardimg {
  position: relative;
  height: 190px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.card.noimg .cardimg {
  background-image: linear-gradient(135deg, #1b1030, #0e2233 60%, #0b0b16) !important;
}
.imgov {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px 16px 10px;
  background: linear-gradient(180deg, rgba(7,7,15,0.15) 0%, rgba(7,7,15,0.25) 45%, rgba(7,7,15,0.88) 100%);
}
.imgov h3 {
  margin: 2px 0 0;
  font-size: 1.05rem;
  line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}
.imgov .hid { text-shadow: 0 1px 4px rgba(0,0,0,0.9); }
.imgov .imgmeta {
  color: var(--text-secondary);
  font-size: 0.78rem;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}
.imgov .tag {
  position: absolute; top: 12px; right: 12px;
  background: rgba(7,7,15,0.65);
}
.cardbody { padding: 12px 16px 13px; }
.cardbody .meta { margin: 0 0 9px; }

/* ── v2: rating sliders ── */
.sliders { margin-top: 10px; border-top: 1px solid var(--hairline); padding-top: 9px; }
.srow { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.srow .who {
  font-size: 0.73rem; font-weight: 700; letter-spacing: 0.05em;
  width: 4.4em; flex: none;
}
.srow .who.m { color: var(--glow-cyan); }
.srow .who.h { color: var(--glow-pink); }
.srow input.rate {
  flex: 1; height: 20px; margin: 0; cursor: pointer;
  background: transparent;
}
.srow input.rate.m { accent-color: #22d9ee; }
.srow input.rate.h { accent-color: #ff3da6; }
.srow .sval {
  width: 1.6em; flex: none; text-align: right;
  font-weight: 750; font-size: 0.88rem;
  transition: text-shadow 0.2s;
}
.srow .sval.m { color: var(--glow-cyan); }
.srow .sval.h { color: var(--glow-pink); }
.srow .sval.saved { text-shadow: 0 0 10px currentColor; }
.srow .sval.err { color: var(--status-critical); }

/* ── v2: detail image ── */
.detailimg {
  height: 240px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background-size: cover;
  background-position: center;
  background-color: var(--surface-1);
  margin: 16px 0 4px;
}
#detail .sliders { border: 1px solid var(--hairline); border-radius: 10px; padding: 12px 14px; }
