*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --accent: #a8a8a8;
  --accent-bright: #e8e8e8;
  --silver: #c0c0c0;
  --gold: #c0c0c0;
  --bg-dark: #050505;
  --bg-card: rgba(10, 10, 10, 0.94);
  --text: #ececec;
  --text-muted: #9ca3af;
  --border: rgba(192, 192, 192, 0.22);
  --border-bright: rgba(220, 220, 220, 0.45);
  --radius: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  --font-display: "Cinzel", Georgia, serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
  --font-lore: "Libre Baskerville", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-dark);
  line-height: 1.6;
  min-height: 100vh;
}

.has-sidebar {
  display: flex;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

/* Sidebar layout */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  z-index: 200;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: rgba(8, 8, 8, 0.98);
  border-right: 1px solid var(--border-bright);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  padding: 0.5rem 0.75rem;
  margin-bottom: 2rem;
  border-radius: 8px;
  transition: background 0.2s;
}

.sidebar-brand:hover {
  background: rgba(192, 192, 192, 0.06);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  line-height: 1.25;
  display: block;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.sidebar-brand-sub {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.85;
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 0.75rem 0;
}

.sidebar-external {
  justify-content: space-between;
}

.external-tag {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--silver);
  opacity: 0.7;
  margin-left: auto;
}

.sidebar-quick {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-connect {
  width: 100%;
  text-align: center;
}

.sidebar-quick .btn-outline {
  width: 100%;
  text-align: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-nav-item.active {
  color: var(--accent-bright);
  background: rgba(192, 192, 192, 0.08);
  border-color: var(--border-bright);
}

.nav-icon {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
  opacity: 0.8;
}

.sidebar-county-link {
  margin-top: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.15), rgba(192, 192, 192, 0.08));
  border: 1px solid rgba(168, 168, 168, 0.35);
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.sidebar-county-link:hover {
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.25), rgba(192, 192, 192, 0.12));
  border-color: rgba(168, 168, 168, 0.5);
}

.sidebar-county-link.active {
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.3), rgba(192, 192, 192, 0.15));
  border-color: var(--accent);
  color: var(--text);
}

.county-icon {
  color: var(--silver);
  font-size: 1.1rem;
}

.county-link-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.county-link-text span:first-child {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.3;
}

.county-sub {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--silver);
  opacity: 0.85;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.sidebar-nav-muted {
  font-size: 0.85rem;
  opacity: 0.7;
}

.page-wrap {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrap main {
  flex: 1;
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 150;
  flex-direction: column;
  gap: 5px;
  background: rgba(8, 8, 8, 0.95);
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  cursor: pointer;
  padding: 10px;
}

.sidebar-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 190;
  background: rgba(0, 0, 0, 0.5);
}

.sidebar-overlay.visible {
  display: block;
}

.footer-back {
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}

.footer-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-back a:hover {
  color: var(--silver);
}

/* Background layers */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(192, 192, 192, 0.06) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 100%, rgba(160, 160, 160, 0.04) 0%, transparent 40%),
    linear-gradient(180deg, #0a0a0a 0%, #050505 50%, #030303 100%);
  background-size: cover;
  background-position: center;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(5, 5, 5, 0.72);
  pointer-events: none;
}

/* Legacy header (customize page) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(8, 8, 8, 0.92);
  border-bottom: 1px solid var(--border-bright);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--silver);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(180deg, #d4d4d4 0%, #a8a8a8 100%);
  color: #0a0a0a;
  border-color: var(--border-bright);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #ececec 0%, #b8b8b8 100%);
  border-color: #f0f0f0;
}

.btn-outline {
  background: transparent;
  color: var(--silver);
  border-color: var(--border-bright);
}

.btn-outline:hover {
  background: rgba(192, 192, 192, 0.1);
  color: var(--accent-bright);
}

.btn-sm {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
}

/* Hero */
.hero {
  padding: 6rem 0 5rem;
  text-align: center;
}

.hero-eyebrow {
  color: var(--silver);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 620px;
  margin: 0 auto 2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-muted);
}

/* Scripts grid */
.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.script-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.script-card:hover {
  transform: translateY(-4px);
  border-color: rgba(192, 192, 192, 0.45);
}

.script-card.featured {
  border-color: rgba(168, 168, 168, 0.4);
}

.script-image {
  height: 160px;
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.2), rgba(192, 192, 192, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.script-image img {
  max-height: 80px;
  max-width: 80px;
  opacity: 0.7;
}

.script-body {
  padding: 1.25rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.script-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tag {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(192, 192, 192, 0.15);
  color: var(--silver);
}

.script-body h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.script-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
  margin-bottom: 1rem;
}

.script-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.script-price {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--silver);
  font-weight: 700;
}

/* Redstone County page */
.county-page .hero {
  padding-top: 5rem;
}

.county-hero .server-badge {
  justify-content: center;
  margin-bottom: 1rem;
}

.county-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.county-about {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.county-about h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.county-about p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.county-lore {
  font-style: italic;
  border-left: 3px solid var(--silver);
  padding-left: 1rem;
  opacity: 0.9;
}

.county-emblem-large {
  color: var(--silver);
}

.county-emblem-large svg {
  width: 180px;
  height: 180px;
}

.feature-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.factions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.faction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.faction-card:hover {
  border-color: rgba(192, 192, 192, 0.4);
}

.faction-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: var(--silver);
}

.faction-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.server-links-lg {
  justify-content: center;
}

.server-links-lg .server-link {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}

.county-links-section {
  padding-bottom: 4rem;
}

.page-hero {
  padding: 4rem 0 2rem;
  text-align: center;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  margin-bottom: 0.75rem;
}

.page-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

.container-narrow {
  width: min(640px, 92vw);
  margin-inline: auto;
}

.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
  grid-column: 1 / -1;
}

.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.quick-link-card {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.quick-link-card:hover {
  transform: translateY(-3px);
  border-color: rgba(192, 192, 192, 0.45);
}

.quick-link-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.75rem;
}

.quick-link-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
  color: var(--silver);
}

.quick-link-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.application-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.application-form label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.application-form input,
.application-form textarea,
.application-form select {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem 0.75rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.application-form textarea {
  min-height: 100px;
  resize: vertical;
}

/* Useful info page */
.info-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.info-card-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.info-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--silver);
}

.info-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: -0.25rem 0 1rem;
  padding: 0.6rem 0.75rem;
  background: rgba(192, 192, 192, 0.08);
  border-left: 3px solid var(--silver);
  border-radius: 0 6px 6px 0;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.info-item {
  display: grid;
  grid-template-columns: minmax(100px, auto) 1fr;
  gap: 0.75rem 1rem;
  align-items: start;
}

.info-label {
  display: inline-block;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--silver);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
  word-break: keep-all;
}

.info-label.info-key {
  color: var(--text);
  background: rgba(168, 168, 168, 0.15);
  border-color: rgba(168, 168, 168, 0.35);
  min-width: 2.5rem;
  text-align: center;
}

.info-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .info-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .info-label {
    white-space: normal;
    word-break: break-word;
  }
}

/* Town businesses */
.town-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.town-picker-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  color: inherit;
  font: inherit;
}

.town-picker-card:hover,
.town-picker-card.is-active {
  border-color: var(--silver);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.town-picker-card.is-active {
  background: rgba(192, 192, 192, 0.08);
}

.town-picker-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--silver);
  margin-bottom: 0.4rem;
}

.town-picker-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.45;
  margin-bottom: 0.75rem;
}

.town-picker-cta {
  font-size: 0.8rem;
  color: var(--silver);
  letter-spacing: 0.02em;
}

.town-detail-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.town-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.town-detail-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--silver);
  margin-bottom: 0.25rem;
}

.town-detail-header h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--silver);
  margin-bottom: 0.35rem;
}

.town-detail-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.town-business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.town-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.town-card-header h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--silver);
  margin-bottom: 0.35rem;
}

.town-card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.town-business-list {
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.town-business-item {
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.town-business-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.town-business-name strong {
  font-family: var(--font-display);
  font-size: 1rem;
}

.town-business-role {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--silver);
  background: rgba(192, 192, 192, 0.12);
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.town-business-item p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.town-apply-btn {
  margin-top: 0.75rem;
}

.job-card.is-active {
  border-color: var(--silver);
  box-shadow: 0 0 0 1px rgba(192, 192, 192, 0.35);
}

.form-hint {
  color: var(--silver);
  font-size: 0.9rem;
  margin: -0.25rem 0 1rem;
}

.form-alert {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.form-alert-success {
  background: rgba(109, 212, 126, 0.12);
  color: #6dd47e;
  border: 1px solid rgba(109, 212, 126, 0.25);
}

.form-alert-error {
  background: rgba(224, 112, 112, 0.12);
  color: #e07070;
  border: 1px solid rgba(224, 112, 112, 0.25);
}

.jobs-list {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.job-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.job-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.job-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.job-req {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.properties-grid,
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.listing-card,
.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.listing-card.listing-sold {
  opacity: 0.92;
}

.listing-image,
.property-image {
  position: relative;
  height: 170px;
  background: linear-gradient(135deg, rgba(168, 168, 168, 0.15), rgba(192, 192, 192, 0.08));
  overflow: hidden;
}

.listing-image img,
.property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s;
}

.listing-sold .listing-image img {
  filter: grayscale(0.5) brightness(0.65);
}

.sold-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.sold-stamp span {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  color: #e03030;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: 5px solid #e03030;
  padding: 0.35rem 1.75rem;
  transform: rotate(-14deg);
  background: rgba(5, 5, 5, 0.88);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.listing-body,
.property-body {
  padding: 1.25rem;
}

.listing-body h3,
.property-body h3 {
  font-family: var(--font-display);
  margin-bottom: 0.35rem;
}

.listing-meta,
.property-location {
  color: var(--silver);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.listing-body p,
.property-body p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.listing-price,
.property-price {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--silver);
  font-weight: 700;
}

.listing-price-sold {
  color: var(--text-muted);
  text-decoration: line-through;
  font-size: 1rem;
}

.server-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6dd47e;
  margin-bottom: 0.75rem;
}

.server-badge.offline {
  color: #e07070;
}

.server-badge.maintenance {
  color: var(--silver);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.server-info h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.server-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  max-width: 520px;
}

.server-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
}

.stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--silver);
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.feature-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
}

.feature-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  color: var(--silver);
  font-size: 0.65rem;
  top: 0.15rem;
}

.server-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.server-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: rgba(192, 192, 192, 0.1);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s, border-color 0.2s;
}

.server-link:hover {
  background: rgba(192, 192, 192, 0.2);
  border-color: var(--silver);
}

.script-card,
.faction-card,
.info-card,
.town-picker-card,
.town-detail-panel,
.town-card,
.job-card,
.listing-card,
.property-card,
.application-form {
  border-color: var(--border-bright);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.server-link.primary {
  background: linear-gradient(180deg, #d4d4d4 0%, #a8a8a8 100%);
  border-color: var(--border-bright);
  color: #0a0a0a;
}

.server-link.primary:hover {
  background: linear-gradient(180deg, #ececec 0%, #b8b8b8 100%);
}

.server-visual {
  text-align: center;
  color: var(--silver);
}

.county-emblem svg {
  width: 140px;
  height: 140px;
}

.visual-caption {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  opacity: 0.7;
  letter-spacing: 0.1em;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  background: rgba(5, 5, 5, 0.85);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.footer-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.footer-brand span {
  font-family: var(--font-display);
  font-weight: 600;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer-social a:hover {
  color: var(--silver);
}

.footer-copy {
  width: 100%;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .page-wrap {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: flex;
  }

  .hero {
    padding-top: 5rem;
  }

  .county-stats-row {
    grid-template-columns: 1fr;
  }

  .county-about {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .county-emblem-large {
    text-align: center;
  }

  .county-emblem-large svg {
    width: 120px;
    height: 120px;
  }
}

/* Server lore — homepage feature */
.lore-feature-section {
  padding-top: 0;
}

.lore-feature {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(8, 8, 8, 0.98));
  border: 1px solid var(--border-bright);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.lore-feature-eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--silver);
  margin-bottom: 0.5rem;
}

.lore-feature-content h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--accent-bright);
  margin-bottom: 1rem;
  line-height: 1.25;
}

.lore-feature-teaser {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  max-width: 52ch;
}

.lore-feature-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  border-left: 1px solid var(--border-bright);
}

.lore-feature-mark {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.2em;
  color: var(--silver);
  line-height: 1;
}

.lore-feature-year {
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
}

/* Lore page — leather-bound book */
.lore-page .bg-layer {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(192, 192, 192, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #080808 0%, #030303 100%);
}

.lore-hero {
  padding: 3rem 0 1.5rem;
  text-align: center;
}

.lore-hero .hero-eyebrow {
  color: var(--silver);
}

.lore-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: 0.2em;
  color: var(--accent-bright);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 30px rgba(192, 192, 192, 0.15);
}

.lore-subtitle {
  font-family: var(--font-lore);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-style: italic;
  color: var(--text-muted);
}

.lore-body-section {
  padding: 1rem 0 4rem;
}

.lore-body-section .container-narrow {
  width: min(860px, 92vw);
}

.lore-book {
  max-width: 820px;
  margin: 0 auto;
  padding: 0.85rem 1rem 1rem 1.35rem;
  background:
    linear-gradient(90deg, rgba(192, 192, 192, 0.12) 0%, transparent 3%),
    linear-gradient(180deg, #141414 0%, #080808 55%, #030303 100%);
  border-radius: 4px 12px 12px 4px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset -6px 0 16px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(192, 192, 192, 0.35);
  position: relative;
}

.lore-book::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 0.75rem;
  bottom: 0.75rem;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(220, 220, 220, 0.5), rgba(140, 140, 140, 0.25));
  box-shadow: 0 0 8px rgba(192, 192, 192, 0.15);
}

.lore-book::before {
  content: "";
  display: block;
  height: 3px;
  margin: 0 2rem 0.65rem 0.5rem;
  background: linear-gradient(90deg, transparent, rgba(220, 220, 220, 0.45), transparent);
  border-radius: 2px;
}

.lore-book-inner {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(120, 110, 95, 0.06) 27px,
      rgba(120, 110, 95, 0.06) 28px
    ),
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.35) 0%, transparent 55%),
    linear-gradient(180deg, #f4f0e8 0%, #e8e2d6 100%);
  color: #1c1c1c;
  padding: 2.75rem 2.85rem 3rem;
  border: 1px solid rgba(180, 175, 165, 0.8);
  box-shadow:
    inset 0 0 80px rgba(100, 95, 85, 0.08),
    inset 0 2px 0 rgba(255, 255, 255, 0.5);
  position: relative;
}

.lore-book-inner::before,
.lore-book-inner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(120, 115, 105, 0.18);
}

.lore-book-inner::before {
  left: 2rem;
}

.lore-book-inner::after {
  right: 2rem;
}

.lore-opening {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px double rgba(100, 95, 85, 0.45);
}

.lore-opening p {
  font-family: var(--font-lore);
  font-size: 1.15rem;
  line-height: 1.85;
  color: #242424;
  margin-bottom: 0.5rem;
}

.lore-opening em {
  color: #3a3a3a;
  font-style: italic;
}

.lore-toc {
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(120, 115, 105, 0.35);
  border-radius: 2px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.lore-toc-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #3a3a3a;
  margin-bottom: 0.75rem;
}

.lore-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2;
  column-gap: 2rem;
}

.lore-toc li {
  margin-bottom: 0.4rem;
  break-inside: avoid;
}

.lore-toc a {
  color: #333;
  text-decoration: none;
  font-family: var(--font-lore);
  font-size: 0.9rem;
  transition: color 0.2s;
}

.lore-toc a:hover {
  color: #111;
  text-decoration: underline;
}

.lore-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(100, 95, 85, 0.3);
}

.lore-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.lore-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #222;
  margin-bottom: 1rem;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.lore-section p {
  font-family: var(--font-lore);
  color: #242424;
  font-size: 1rem;
  line-height: 1.9;
  margin-bottom: 0.85rem;
}

.lore-section em {
  color: #111;
  font-style: italic;
}

.lore-section strong {
  color: #222;
  font-weight: 700;
}

.lore-section-closing {
  margin-top: 1.5rem;
  padding: 1.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.04);
  border: 1px double rgba(100, 95, 85, 0.4);
  border-radius: 2px;
}

.lore-section-closing p:last-child {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: #111;
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.03em;
}

.lore-section-closing p:nth-last-child(2) {
  font-family: var(--font-lore);
  font-size: 1rem;
  color: #242424;
  text-align: center;
}

@media (max-width: 768px) {
  .lore-feature {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .lore-feature-aside {
    border-left: none;
    border-top: 1px solid var(--border-bright);
    padding-top: 1.5rem;
  }

  .lore-book-inner {
    padding: 1.75rem 1.25rem 2rem;
  }

  .lore-book-inner::before,
  .lore-book-inner::after {
    display: none;
  }

  .lore-toc ol {
    columns: 1;
  }
}
