/* ── Reset & Base ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #161f14;
  --surface:   #1e2d1b;
  --surface2:  #263823;
  --border:    #35502f;
  --text:      #e2edd8;
  --text-muted:#7fa070;
  --accent:    #f5ff9e;
  --accent-dim:#d6c43a28;
  --green:     #4a7a3d;
  --radius:    10px;
  --radius-lg: 16px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(22,31,20,0.95);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo {
  font-family: 'Cinzel', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  user-select: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Main ───────────────────────────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  width: 100%;
}

/* ── Home Grid ──────────────────────────────────────────────────────────── */
.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.home-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}

.home-card:hover {
  background: var(--surface2);
  transform: translateY(-2px);
}

.home-card h2 {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.home-card p { color: var(--text-muted); font-size: 0.875rem; line-height: 1.5; }

/* ── Faction Strip ──────────────────────────────────────────────────────── */
.home-factions-preview { margin-top: 0.5rem; }

.faction-strip {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.faction-strip-item {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  transition: background 0.2s, transform 0.15s;
}

.faction-strip-item:hover { background: var(--surface2); transform: translateY(-2px); }

.strip-name  { font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.9rem; letter-spacing: 0.03em; }
.strip-count { color: var(--text-muted); font-size: 0.8rem; }

/* ── Section Title ──────────────────────────────────────────────────────── */
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface2);
  color: var(--text-muted);
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  text-transform: none;
  letter-spacing: 0;
  padding: 1px 8px;
  border: 1px solid var(--border);
}

/* ── Page Header ────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 2rem; }

.page-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.4rem;
  letter-spacing: 0.04em;
}

.page-header p { color: var(--text-muted); }

/* ── Card Grid ──────────────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.card:hover { background: var(--surface2); transform: translateY(-2px); }

.card-title {
  font-family: 'Cinzel', serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.card-desc   { color: var(--text-muted); font-size: 0.875rem; line-height: 1.55; flex: 1; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ── Badge ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid;
}

/* ── Filter Bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  padding: 0.3rem 0.9rem;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover  { color: var(--text); border-color: var(--accent); }
.filter-btn.active { color: var(--bg); background: var(--accent); border-color: var(--accent); font-weight: 700; }

/* ── POI Card ───────────────────────────────────────────────────────────── */
.poi-card-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.poi-type-tag {
  display: inline-block;
  background: var(--surface2);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.poi-status {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.status-active   { color: #8fd16a; background: #8fd16a15; }
.status-inactive { color: #c47c5a; background: #c47c5a15; }

.coords-inline { font-size: 0.75rem; color: var(--text-muted); font-family: 'Consolas', monospace; }

/* ── Members Grid ───────────────────────────────────────────────────────── */
.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.member-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.member-card:hover { background: var(--surface2); transform: translateY(-2px); }

.member-card-avatar {
  width: 64px;
  height: 64px;
  image-rendering: pixelated;
  border-radius: 8px;
  margin-bottom: 0.25rem;
  border: 2px solid var(--border);
}

.member-card-name {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.member-card-role     { color: var(--text-muted); font-size: 0.78rem; }
.member-card-specialty{ color: var(--text-muted); font-size: 0.78rem; margin-top: 0.2rem; }

/* ── Detail Pages ───────────────────────────────────────────────────────── */
.detail-back { margin-bottom: 1.5rem; }

.back-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.back-btn:hover { color: var(--accent); border-color: var(--accent); }

.detail-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 2rem;
}

.detail-hero-text h1 {
  font-family: 'Cinzel', serif;
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: 0.03em;
}

.detail-hero-text p { color: var(--text-muted); line-height: 1.65; }

.poi-detail-tags { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }

/* ── Detail Info Grid ───────────────────────────────────────────────────── */
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.info-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.info-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
}

.info-value { font-size: 0.95rem; font-weight: 600; }

.mono { font-family: 'Consolas', monospace; font-size: 0.82rem; }

.link-span { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-span:hover { opacity: 0.8; }

/* ── Detail Sections ────────────────────────────────────────────────────── */
.detail-sections { display: flex; flex-direction: column; gap: 2rem; }
.detail-section  { margin-bottom: 2rem; }

/* ── Member Row ─────────────────────────────────────────────────────────── */
.member-list { display: flex; flex-direction: column; gap: 0.5rem; }

.member-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.member-row:hover { background: var(--surface2); border-color: var(--accent); }

.member-avatar {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.member-row-info { display: flex; flex-direction: column; gap: 2px; }

.member-row-name {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.member-row-role { color: var(--text-muted); font-size: 0.78rem; }

/* ── POI Row ────────────────────────────────────────────────────────────── */
.poi-list { display: flex; flex-direction: column; gap: 0.5rem; }

.poi-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.poi-row:hover { background: var(--surface2); border-color: var(--accent); }

.poi-row-left { display: flex; align-items: center; gap: 0.6rem; }
.poi-row-name { font-weight: 600; font-size: 0.92rem; }
.poi-coords   { color: var(--text-muted); font-size: 0.72rem; font-family: 'Consolas', monospace; white-space: nowrap; }

/* ── Member Detail Hero ─────────────────────────────────────────────────── */
.member-detail-hero { align-items: center; }

.member-detail-avatar {
  width: 96px;
  height: 96px;
  image-rendering: pixelated;
  border-radius: 12px;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .detail-hero { flex-direction: column; }
  .member-detail-hero { flex-direction: column; align-items: flex-start; }
  main { padding: 1.5rem 1rem; }
  .page-header h1 { font-size: 1.6rem; }
}
