:root {
  --navy: #081a3a;
  --deep: #030712;
  --gold: #d4af37;
  --gold-soft: #f2d675;
  --silver: #b8bec9;
  --blue: #4a90ff;
  --green: #30c46c;
  --red: #c94040;
  --panel: rgba(5, 12, 26, 0.86);
  --border: rgba(212, 175, 55, 0.35);
  --world-map-width: 3000px;
  --world-map-aspect: 1536 / 1024;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: #f5f7fa;
  background: var(--deep);
  min-height: 100vh;
  overflow: hidden;
}

body.property-modal-open,
body.estate-detail-open {
  overflow: hidden;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(3,7,18,0.2), rgba(3,7,18,0.9)),
    url("https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?auto=format&fit=crop&w=2200&q=80");
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) contrast(1.05);
  z-index: -2;
}

.overlay {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(212,175,55,0.14), transparent 35%),
    linear-gradient(90deg, rgba(3,7,18,0.92), rgba(8,26,58,0.68), rgba(3,7,18,0.92));
  z-index: -1;
}

.test-version-badge {
  position: fixed;
  right: 16px;
  top: 16px;
  z-index: 50;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 999px;
  background: rgba(5,12,26,0.72);
  color: #f7e6a5;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 8px 11px;
  pointer-events: none;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

/* Desktop app shell */
.app-shell {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.layout {
  width: 100%;
  margin: 0;
}

/* Sidebar */
.app-sidebar {
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 16px;
  border-right: 1px solid rgba(242,214,117,0.24);
  background:
    linear-gradient(180deg, rgba(5,12,26,0.92), rgba(8,20,38,0.86)),
    radial-gradient(circle at 25% 0%, rgba(242,214,117,0.12), transparent 34%);
  box-shadow:
    18px 0 52px rgba(0,0,0,0.28),
    inset -1px 0 0 rgba(255,255,255,0.04);
  scrollbar-color: rgba(212,175,55,0.42) rgba(5,12,26,0.74);
}

.topbar {
  width: 100%;
  margin: 0;
  padding: 0 0 14px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 2px solid var(--gold);
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 24px rgba(212,175,55,0.25);
}

.brand h1, .brand p { margin: 0; }

.brand h1 {
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 24px;
}

.brand p {
  color: var(--silver);
  font-size: 14px;
}

.gold-btn {
  border: 1px solid rgba(242,214,117,0.75);
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #1b1203;
  padding: 13px 22px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}

.gold-btn:hover { transform: translateY(-1px); }

.gold-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

#connectWalletBtn {
  position: static;
  width: 100%;
  max-width: none;
  min-width: 0;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 13px;
  white-space: nowrap;
  box-shadow:
    0 8px 20px rgba(0,0,0,0.26),
    0 0 18px rgba(242,214,117,0.14);
}

.full { width: 100%; }

.hero-card {
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(5,12,26,0.95), rgba(8,26,58,0.78));
  border-radius: 28px;
  padding: 34px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}

.legacy-intro {
  display: none;
}

.eyebrow {
  color: var(--gold-soft);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 800;
  margin: 0 0 10px;
}

.hero-card h2, .map-header h2 {
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1;
  margin: 0 0 14px;
}

.hero-card p {
  max-width: 760px;
  color: #dce4f2;
  font-size: 18px;
  line-height: 1.55;
}

.status-box {
  margin-top: 22px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(74,144,255,0.45);
  background: rgba(74,144,255,0.1);
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.dashboard .panel:nth-child(1) {
  order: 1;
  align-self: start;
}

.dashboard .panel:nth-child(2) {
  order: 2;
}

.dashboard .panel:nth-child(3) {
  order: 3;
  border-color: rgba(242,214,117,0.26);
  background:
    linear-gradient(145deg, rgba(242,214,117,0.06), rgba(5,12,26,0.86));
}

.wallet-panel {
  padding: 14px;
}

.wallet-panel p {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}

.wallet-panel .gold-btn {
  padding: 10px 14px;
}

.worms-panel {
  max-height: 270px;
  overflow: visible;
}

.selected-estate-panel {
  flex: 1 1 auto;
}

.estate-compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
}

.estate-compact-summary span {
  color: rgba(216,226,241,0.72);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.estate-compact-summary strong {
  color: #f8e9aa;
  font-size: 12px;
  text-align: right;
}

.estate-ranking-panel {
  border: 1px solid rgba(184,190,201,0.18);
  border-radius: 22px;
  background: rgba(5,12,26,0.82);
  margin: 12px 0 0;
  padding: 20px;
  order: initial;
  box-shadow:
    0 18px 48px rgba(0,0,0,0.26),
    inset 0 0 0 1px rgba(255,255,255,0.04);
}

.estate-ranking-panel[hidden] {
  display: none;
}

.estate-ranking-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.estate-ranking-header h2 {
  margin: 0;
  color: #fff7d3;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1;
}

.estate-ranking-header > span {
  flex: 0 0 auto;
  border: 1px solid rgba(242,214,117,0.3);
  border-radius: 999px;
  background: rgba(242,214,117,0.1);
  color: #f8e9aa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  padding: 8px 10px;
  text-transform: uppercase;
}

.estate-ranking-list {
  display: grid;
  gap: 8px;
}

.estate-ranking-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(255,255,255,0.055);
  color: #f5f7fa;
  cursor: pointer;
  padding: 10px;
  text-align: left;
  transition: 0.18s ease;
}

.estate-ranking-row:hover,
.estate-ranking-row.is-selected {
  border-color: rgba(242,214,117,0.44);
  background: rgba(242,214,117,0.1);
  box-shadow: 0 0 18px rgba(242,214,117,0.12);
}

.ranking-position {
  color: #f8e9aa;
  font-size: 16px;
  font-weight: 900;
}

.ranking-estate,
.ranking-estate strong,
.ranking-estate small {
  display: block;
  min-width: 0;
}

.ranking-estate strong {
  color: #fff7d3;
  font-size: 14px;
}

.ranking-estate small {
  margin-top: 3px;
  color: rgba(216,226,241,0.68);
  font-size: 11px;
  font-weight: 800;
}

.ranking-house {
  grid-column: 2;
  color: rgba(247,250,255,0.86);
  font-size: 12px;
  font-weight: 800;
}

.ranking-score {
  grid-column: 2;
  justify-self: end;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #f8e9aa;
  font-size: 13px;
  font-weight: 900;
  padding: 7px 9px;
}

.panel {
  min-width: 0;
  border: 1px solid rgba(184,190,201,0.18);
  background: var(--panel);
  border-radius: 18px;
  padding: 14px;
}

.dashboard .panel:nth-child(1) {
  padding: 14px;
}

.dashboard .panel:nth-child(1) p {
  margin-bottom: 12px;
  font-size: 13px;
}

.panel h3 {
  margin: 0 0 12px;
  color: var(--gold-soft);
  font-size: 17px;
}

.panel p {
  color: #dce4f2;
  overflow-wrap: anywhere;
}

.plot-info-card {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.plot-info-summary {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #f5df99;
  font-weight: 800;
}

.estate-identity-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(242,214,117,0.22);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(242,214,117,0.08), rgba(255,255,255,0.045));
  padding: 12px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    0 12px 28px rgba(0,0,0,0.16);
}

.estate-identity-card[hidden] {
  display: none;
}

.estate-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.estate-label {
  display: block;
  color: rgba(216,226,241,0.66);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.estate-banner h4 {
  margin: 4px 0 0;
  color: #fff7d3;
  font-size: 18px;
  line-height: 1.1;
}

.estate-rank-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(242,214,117,0.48);
  border-radius: 999px;
  background: rgba(242,214,117,0.14);
  color: #f8e9aa;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 7px 9px;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(242,214,117,0.12);
}

.estate-identity-card[data-rank="settler"] .estate-rank-badge {
  border-color: rgba(186,220,255,0.48);
  background: rgba(142,198,255,0.12);
}

.estate-identity-card[data-rank="landholder"] .estate-rank-badge {
  border-color: rgba(190,236,190,0.5);
  background: rgba(48,196,108,0.12);
}

.estate-identity-card[data-rank="baron"] .estate-rank-badge {
  border-color: rgba(222,190,255,0.5);
  background: rgba(160,112,220,0.14);
}

.estate-identity-card[data-rank="high-lord"] .estate-rank-badge {
  border-color: rgba(255,244,194,0.72);
  background: rgba(242,214,117,0.2);
  box-shadow: 0 0 20px rgba(242,214,117,0.22);
}

.estate-identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.estate-identity-grid div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  padding: 9px 10px;
}

.estate-identity-grid dt {
  margin: 0 0 5px;
  color: rgba(216,226,241,0.66);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.estate-identity-grid dd {
  margin: 0;
  color: #f7faff;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.rename-estate-btn {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  color: #f5df99;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 12px;
  transition: 0.18s ease;
  width: 100%;
}

.rename-estate-btn:hover {
  border-color: rgba(242,214,117,0.48);
  background: rgba(242,214,117,0.1);
}

.plot-info-sections {
  display: grid;
  gap: 10px;
}

.plot-info-section {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 14px;
  background: rgba(255,255,255,0.045);
  padding: 10px;
  backdrop-filter: blur(8px);
}

.plot-info-section h4 {
  margin: 0 0 9px;
  color: rgba(242,214,117,0.9);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.plot-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.plot-info-grid div,
.plot-future-grid span {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  padding: 9px 10px;
}

.plot-info-grid dt {
  margin: 0 0 5px;
  color: rgba(216,226,241,0.68);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.plot-info-grid dd {
  margin: 0;
  color: #f7faff;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.plot-future-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 8px;
}

.property-management-btn,
.upgrade-house-btn {
  min-width: 0;
  border: 1px solid rgba(242,214,117,0.72);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,236,164,0.96), rgba(212,175,55,0.92));
  color: #1b1203;
  cursor: pointer;
  font-weight: 900;
  line-height: 1.2;
  padding: 10px 12px;
  transition: 0.18s ease;
  width: 100%;
}

.property-management-btn {
  margin-top: 10px;
}

.property-management-btn[hidden] {
  display: none;
}

.property-management-btn:hover,
.upgrade-house-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 10px 24px rgba(0,0,0,0.24),
    0 0 18px rgba(242,214,117,0.24);
}

.upgrade-house-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.property-management-modal[hidden] {
  display: none;
}

.estate-detail-modal[hidden] {
  display: none;
}

.estate-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 78;
  display: grid;
  place-items: center;
  padding: 22px;
}

.estate-detail-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(74,144,255,0.12), transparent 34%),
    rgba(3,7,18,0.7);
  backdrop-filter: blur(8px);
}

.estate-detail-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(86vh, 840px);
  overflow: auto;
  border: 1px solid rgba(242,214,117,0.28);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(5,12,26,0.96), rgba(8,26,58,0.9));
  box-shadow:
    0 30px 90px rgba(0,0,0,0.48),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  padding: 22px;
}

.estate-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.estate-detail-header h2 {
  margin: 0 0 8px;
  color: #fff7d3;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

.estate-detail-header p:not(.eyebrow) {
  margin: 0;
  color: rgba(216,226,241,0.76);
}

.estate-detail-art {
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 45%, rgba(242,214,117,0.12), transparent 42%),
    rgba(255,255,255,0.045);
  min-height: 112px;
  display: grid;
  place-items: center;
}

.estate-art-placeholder {
  width: min(100%, 640px);
  height: clamp(220px, 32vh, 360px);
  border: 1px solid rgba(242,214,117,0.32);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255,244,194,0.12), rgba(5,12,26,0.18));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow:
    0 16px 32px rgba(0,0,0,0.24),
    0 0 24px rgba(242,214,117,0.14);
}

.estate-art-level-1 { border-color: rgba(242,214,117,0.42); }
.estate-art-level-2 { border-color: rgba(186,220,255,0.56); }
.estate-art-level-3 { border-color: rgba(190,236,190,0.56); }
.estate-art-level-4 { border-color: rgba(222,190,255,0.62); }
.estate-art-level-5 {
  border-color: rgba(255,244,194,0.9);
  box-shadow:
    0 18px 36px rgba(0,0,0,0.26),
    0 0 30px rgba(242,214,117,0.32);
}

.estate-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.estate-detail-grid div,
.valhalla-summary div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  padding: 10px;
}

.estate-detail-grid dt,
.valhalla-summary dt {
  margin: 0 0 5px;
  color: rgba(216,226,241,0.66);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.estate-detail-grid dd,
.valhalla-summary dd {
  margin: 0;
  color: #f7faff;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.estate-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.valhalla-gate-marker {
  position: absolute;
  left: 50%;
  top: 82px;
  z-index: 32;
  transform: translateX(-50%);
  border: 1px solid rgba(255,244,194,0.92);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.82), transparent 34%),
    linear-gradient(145deg, rgba(255,255,244,0.92), rgba(242,214,117,0.52));
  color: #251804;
  cursor: pointer;
  padding: 13px 18px;
  box-shadow:
    0 14px 34px rgba(92,62,42,0.22),
    0 0 34px rgba(242,214,117,0.42),
    inset 0 0 0 1px rgba(255,255,255,0.6);
}

.valhalla-gate-marker::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: calc(100% - 4px);
  width: 42px;
  height: 28px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,244,194,0.84);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  background: rgba(255,255,244,0.72);
}

.valhalla-gate-marker strong,
.valhalla-gate-marker span {
  display: block;
}

.valhalla-gate-marker strong {
  font-size: 13px;
  font-weight: 900;
}

.valhalla-gate-marker span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.valhalla-top-three {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.valhalla-estate-row {
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #f7faff;
  cursor: pointer;
  padding: 10px;
  text-align: left;
}

.valhalla-estate-row strong,
.valhalla-estate-row span {
  display: block;
}

.valhalla-estate-row span {
  margin-top: 4px;
  color: rgba(216,226,241,0.72);
  font-size: 12px;
  font-weight: 800;
}

.property-management-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
}

.property-management-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(242,214,117,0.12), transparent 30%),
    rgba(3,7,18,0.72);
  backdrop-filter: blur(8px);
}

.property-management-panel {
  position: relative;
  z-index: 1;
  width: min(980px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
  border: 1px solid rgba(242,214,117,0.32);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(5,12,26,0.96), rgba(8,26,58,0.9)),
    rgba(255,255,255,0.08);
  box-shadow:
    0 30px 90px rgba(0,0,0,0.48),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  padding: 22px;
}

.property-management-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.property-management-header h2 {
  margin: 0 0 8px;
  color: #fff7d3;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.property-management-header p:not(.eyebrow) {
  margin: 0;
  color: rgba(216,226,241,0.78);
}

.property-close-btn {
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #f5f7fa;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 12px;
}

.property-close-btn:hover {
  border-color: rgba(242,214,117,0.5);
  background: rgba(242,214,117,0.12);
}

.property-management-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.property-management-section {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  padding: 14px;
  backdrop-filter: blur(10px);
}

.property-house-section {
  border-color: rgba(242,214,117,0.26);
  background:
    linear-gradient(145deg, rgba(242,214,117,0.08), rgba(255,255,255,0.045));
}

.property-management-section h3 {
  margin: 0 0 12px;
  color: rgba(242,214,117,0.94);
  font-size: 13px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.estate-unlock-state {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  padding: 10px;
}

.estate-unlock-state strong,
.estate-unlock-state span {
  display: block;
}

.estate-unlock-state strong {
  color: #fff7d3;
  font-size: 13px;
}

.estate-unlock-state span {
  color: rgba(216,226,241,0.74);
  font-size: 12px;
  font-weight: 800;
}

.estate-unlock-state.is-locked {
  border-color: rgba(255,255,255,0.09);
  background: rgba(255,255,255,0.035);
  opacity: 0.72;
}

.future-upgrade-list {
  display: grid;
  gap: 8px;
}

.future-upgrade-card {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.052);
  padding: 10px;
}

.future-upgrade-card > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.future-upgrade-card strong,
.future-upgrade-card span {
  display: block;
}

.future-upgrade-card strong {
  color: #f7faff;
  font-size: 13px;
}

.future-upgrade-card span {
  color: rgba(242,214,117,0.76);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.future-upgrade-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.future-upgrade-card dl div {
  min-width: 0;
  border-radius: 9px;
  background: rgba(255,255,255,0.045);
  padding: 7px;
}

.future-upgrade-card dt {
  margin: 0 0 4px;
  color: rgba(216,226,241,0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.future-upgrade-card dd {
  margin: 0;
  color: #f7faff;
  font-size: 11px;
  font-weight: 800;
}

.future-upgrade-card button {
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  background: rgba(255,255,255,0.07);
  color: #f5df99;
  cursor: pointer;
  font-weight: 900;
  padding: 9px 10px;
}

.future-upgrade-card button:hover {
  border-color: rgba(242,214,117,0.48);
  background: rgba(242,214,117,0.1);
}

.future-upgrade-card.is-locked {
  opacity: 0.68;
}

.management-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.management-data-grid div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  padding: 9px 10px;
}

.management-data-grid dt {
  margin: 0 0 5px;
  color: rgba(216,226,241,0.66);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.management-data-grid dd {
  margin: 0;
  color: #f7faff;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.management-note,
.database-note {
  margin: 0;
  color: rgba(216,226,241,0.68);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.database-note {
  margin-top: 8px;
}

.plot-future-grid span {
  color: rgba(216,226,241,0.8);
  font-size: 12px;
  font-weight: 800;
}

.plot-future-grid strong {
  display: block;
  margin-top: 4px;
  color: rgba(242,214,117,0.82);
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.worm-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-color: rgba(212,175,55,0.42) rgba(5,12,26,0.32);
}

.worm-card {
  border: 1px solid rgba(184,190,201,0.22);
  background: rgba(255,255,255,0.06);
  color: white;
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
  min-width: 0;
  text-align: left;
}

.worm-card strong, .worm-card span { display: block; }

.worm-card span {
  margin-top: 4px;
  color: var(--silver);
  font-size: 13px;
}

.worm-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212,175,55,0.2);
}

.empty-message {
  margin: 0;
  color: var(--silver);
  line-height: 1.45;
}

/* Main world area */
.world-main {
  min-width: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-section {
  border: 1px solid var(--border);
  background: rgba(8, 24, 35, 0.5);
  border-radius: 0;
  padding: 16px;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.map-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
  flex: 0 0 auto;
}

.map-header h2 {
  font-size: clamp(28px, 3.2vw, 46px);
}

.map-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: #dce4f2;
  font-size: 14px;
}

.legend i {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  display: inline-block;
  margin-right: 6px;
  vertical-align: -2px;
}

.legend .available {
  border: 1px solid rgba(242,214,117,0.7);
  background: transparent;
}
.legend .claimed { background: rgba(242,214,117,0.2); }
.legend .yours { background: var(--gold); }
.legend .selected { background: var(--blue); }

.map-toggle-btn {
  border: 1px solid rgba(242,214,117,0.56);
  border-radius: 999px;
  background: rgba(5,12,26,0.58);
  color: #f7e6a5;
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
  box-shadow: inset 0 0 18px rgba(212,175,55,0.08);
  transition: 0.18s ease;
}

.map-toggle-btn:hover,
.map-toggle-btn.is-active {
  border-color: rgba(242,214,117,0.92);
  background: rgba(212,175,55,0.16);
  box-shadow:
    inset 0 0 18px rgba(212,175,55,0.14),
    0 0 16px rgba(212,175,55,0.18);
}

.world-navigation {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
  overflow-x: auto;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 18px;
  background: rgba(255,255,255,0.09);
  backdrop-filter: blur(10px) saturate(1.12);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.08),
    0 12px 30px rgba(0,0,0,0.14);
  scrollbar-color: rgba(242,214,117,0.44) rgba(255,255,255,0.08);
  flex: 0 0 auto;
}

.world-nav-item {
  flex: 0 0 auto;
  min-width: 150px;
  border: 1px solid rgba(255,255,255,0.26);
  border-radius: 14px;
  background: rgba(255,255,255,0.12);
  color: rgba(246,249,255,0.92);
  cursor: pointer;
  padding: 10px 12px;
  text-align: left;
  transition: 0.18s ease;
}

.world-nav-item strong,
.world-nav-item span {
  display: block;
}

.world-nav-item strong {
  font-size: 12px;
  line-height: 1.15;
}

.world-nav-item span {
  margin-top: 4px;
  color: rgba(226,235,248,0.72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.world-nav-item:hover,
.world-nav-item.is-active {
  border-color: rgba(255,255,255,0.62);
  background: rgba(255,255,255,0.22);
  color: #ffffff;
  box-shadow:
    0 0 18px rgba(255,255,255,0.14),
    inset 0 0 16px rgba(255,255,255,0.1);
}

.world-nav-item.is-active span {
  color: rgba(255,232,142,0.9);
}

.kingdom-map {
  position: relative;
}

.map-viewport {
  height: 100%;
  width: 100%;
  min-height: 0;
  flex: 1;
  border: 1px solid rgba(242,214,117,0.44);
  border-radius: 20px;
  overflow: auto;
  background: linear-gradient(180deg, rgba(81, 152, 178, 0.34), rgba(16, 64, 91, 0.38));
  box-shadow:
    inset 0 0 38px rgba(255,255,255,0.08),
    0 22px 60px rgba(0,0,0,0.24);
  scrollbar-color: rgba(212,175,55,0.58) rgba(5,12,26,0.72);
}

.world-map {
  width: var(--world-map-width);
  height: auto;
  aspect-ratio: var(--world-map-aspect);
  overflow: visible;
  background: #173b42;
  box-shadow:
    inset 0 0 120px rgba(23,62,60,0.32),
    inset 0 0 0 1px rgba(242,214,117,0.28);
}

.map-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  z-index: 0;
}

.world-map::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 56%, rgba(5,12,26,0.18) 100%);
  pointer-events: none;
  z-index: 1;
}

.world-map::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(61, 35, 13, 0.42);
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px rgba(242,214,117,0.08);
  pointer-events: none;
  z-index: 1;
}

.blueprint-view .map-viewport {
  background: #f7f9fb;
  box-shadow:
    inset 0 0 0 1px rgba(12,24,42,0.08),
    0 22px 60px rgba(0,0,0,0.18);
  scrollbar-color: rgba(62, 92, 128, 0.48) rgba(229, 235, 242, 0.9);
}

.blueprint-view .world-map {
  width: 4800px;
  height: 4700px;
  aspect-ratio: auto;
  background:
    linear-gradient(rgba(108,130,156,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,130,156,0.08) 1px, transparent 1px),
    radial-gradient(ellipse at 18% 23%, rgba(94,188,124,0.09), transparent 22%),
    radial-gradient(ellipse at 81% 24%, rgba(130,136,146,0.1), transparent 20%),
    radial-gradient(ellipse at 50% 86%, rgba(90,154,210,0.08), transparent 25%),
    radial-gradient(ellipse at 21% 65%, rgba(54,104,82,0.08), transparent 22%),
    radial-gradient(circle at 50% 18%, rgba(210,226,245,0.72), transparent 26%),
    #f8fafc;
  background-size: 80px 80px, 80px 80px, auto, auto, auto, auto, auto, auto;
  box-shadow:
    inset 0 0 0 1px rgba(54,72,96,0.12),
    inset 0 0 90px rgba(112,135,162,0.1);
}

.blueprint-view .map-background,
.blueprint-view .founder-lands {
  display: none;
}

.blueprint-view .world-map::before {
  background:
    radial-gradient(circle at 18% 22%, rgba(45,92,58,0.08), transparent 18%),
    radial-gradient(circle at 82% 25%, rgba(65,72,82,0.1), transparent 16%),
    radial-gradient(circle at 78% 74%, rgba(108,157,180,0.08), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent 24%, rgba(108,130,156,0.08));
}

.blueprint-view .world-map::after {
  inset: 28px;
  border-color: rgba(74,93,118,0.18);
  border-radius: 24px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.72);
}

.master-blueprint-canvas {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  color: #253246;
  pointer-events: none;
}

.master-blueprint-canvas *,
.blueprint-zone,
.blueprint-cluster,
.master-blueprint-plot {
  pointer-events: none;
}

.blueprint-view .master-blueprint-canvas {
  display: block;
}

.master-plot-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: none;
  pointer-events: none;
}

.blueprint-view .master-plot-overlay {
  display: block;
}

.master-plot-overlay .plot {
  z-index: 31;
  cursor: pointer;
  pointer-events: auto;
}

.blueprint-view .master-plot-overlay .plot {
  width: 50px;
  height: 58px;
  border-color: rgba(255,255,255,0.86);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.68), rgba(232,240,250,0.44));
  backdrop-filter: blur(4px) saturate(1.18);
  color: rgba(37,48,62,0.8);
  font-size: 11px;
  box-shadow:
    0 5px 16px rgba(68,92,122,0.14),
    0 0 14px rgba(255,255,255,0.58),
    inset 0 0 13px rgba(255,255,255,0.5);
  opacity: 0.78;
}

.blueprint-view .master-plot-overlay .plot.available {
  background:
    linear-gradient(145deg, rgba(255,255,255,0.68), rgba(232,240,250,0.44));
  opacity: 0.76;
}

.blueprint-view .master-plot-overlay .plot.claimed {
  border-color: rgba(255,218,190,0.78);
  background:
    linear-gradient(145deg, rgba(255,238,226,0.66), rgba(194,91,72,0.34));
  opacity: 0.86;
}

.blueprint-view .master-plot-overlay .plot.claimed::before {
  top: 9px;
  font-size: 22px;
  color: rgba(255,244,210,0.96);
  text-shadow:
    0 1px 3px rgba(65,35,24,0.72),
    0 0 8px rgba(255,220,160,0.38);
}

.blueprint-view .master-plot-overlay .plot.claimed::after {
  bottom: 7px;
  font-size: 10px;
  color: rgba(42,33,30,0.78);
  opacity: 0.78;
}

.blueprint-view .master-plot-overlay .plot.yours {
  border-color: rgba(255,244,194,0.98);
  background:
    linear-gradient(145deg, rgba(255,255,244,0.82), rgba(231,194,73,0.48));
  box-shadow:
    0 7px 20px rgba(158,122,20,0.18),
    0 0 22px rgba(242,214,117,0.62),
    inset 0 0 15px rgba(255,255,255,0.58);
  opacity: 0.96;
}

.blueprint-view .master-plot-overlay .plot.selected {
  border-color: rgba(190,224,255,1);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.86), rgba(112,176,255,0.44));
  box-shadow:
    0 0 28px rgba(74,144,255,0.78),
    0 0 0 7px rgba(74,144,255,0.14),
    inset 0 0 15px rgba(255,255,255,0.62);
  opacity: 1;
}

.plot.has-house-map-art,
.plot.has-house,
.blueprint-view .master-plot-overlay .plot.has-house,
.blueprint-view .master-plot-overlay .plot.has-house-map-art,
.plot.has-house-map-art.claimed,
.plot.has-house.claimed,
.blueprint-view .master-plot-overlay .plot.has-house-map-art.claimed,
.blueprint-view .master-plot-overlay .plot.has-house.claimed,
.plot.has-house-map-art.yours,
.plot.has-house.yours,
.blueprint-view .master-plot-overlay .plot.has-house-map-art.yours,
.blueprint-view .master-plot-overlay .plot.has-house.yours,
.plot.has-house-map-art.selected,
.plot.has-house.selected,
.blueprint-view .master-plot-overlay .plot.has-house-map-art.selected {
  width: var(--house-hit-width, 80px);
  height: var(--house-hit-height, 80px);
  border-color: transparent;
  background: transparent;
  color: transparent;
  box-shadow: none;
  clip-path: none;
  opacity: 1;
  overflow: visible;
  backdrop-filter: none;
}

.plot.has-house-map-art > span,
.plot.has-house > span,
.plot.has-house-map-art::before,
.plot.has-house::before,
.plot.has-house-map-art::after,
.plot.has-house::after {
  opacity: 0;
  visibility: hidden;
}

.plot.house-map-level-1 { --house-hit-width: 46px; --house-hit-height: 46px; }
.plot.house-map-level-2 { --house-hit-width: 58px; --house-hit-height: 54px; }
.plot.house-map-level-3 { --house-hit-width: 72px; --house-hit-height: 66px; }
.plot.house-map-level-4 { --house-hit-width: 90px; --house-hit-height: 78px; }
.plot.house-map-level-5 { --house-hit-width: 112px; --house-hit-height: 96px; }

.plot.has-house-map-art:hover,
.plot.has-house:hover {
  outline: 0;
}

.map-section.available-only-view .plot.claimed:not(.selected) {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-section.available-only-view .plot.claimed.selected {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-section.available-only-view .plot.has-house:not(.selected) {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-section.available-only-view .plot.has-house.selected,
.map-section.available-only-view .plot.has-house-map-art {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-section.available-only-view .plot.available {
  border-color: rgba(255,244,194,0.95);
  opacity: 0.92;
  box-shadow:
    0 0 18px rgba(242,214,117,0.28),
    inset 0 0 14px rgba(255,255,255,0.5);
}

.blueprint-title {
  position: absolute;
  left: 50%;
  top: 42px;
  transform: translateX(-50%);
  display: grid;
  gap: 4px;
  min-width: 420px;
  padding: 16px 24px;
  border: 1px solid rgba(86,111,143,0.22);
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 18px 45px rgba(60,84,112,0.12);
  text-align: center;
}

.blueprint-title strong {
  font-size: 22px;
  color: #19283b;
}

.blueprint-title span,
.blueprint-landmark {
  color: #637188;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}

.blueprint-landmark {
  position: absolute;
  left: 50%;
  top: 210px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px dashed rgba(88,111,139,0.38);
  border-radius: 999px;
  background: rgba(255,255,255,0.58);
}

.founder-lands {
  position: absolute;
  left: 1120px;
  top: 690px;
  width: 760px;
  height: 620px;
  z-index: 3;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}

.founder-lands::before {
  display: none;
}

.map-terrain,
.landmark,
.district {
  display: none;
}

.map-terrain {
  position: absolute;
  pointer-events: none;
}

.terrain-forest {
  left: -5%;
  top: -7%;
  width: 48%;
  height: 52%;
  border-radius: 44% 56% 62% 38%;
  background:
    radial-gradient(circle at 24% 28%, rgba(16,88,48,0.85) 0 6px, transparent 7px),
    radial-gradient(circle at 44% 44%, rgba(26,115,60,0.82) 0 7px, transparent 8px),
    radial-gradient(circle at 66% 24%, rgba(10,69,43,0.9) 0 8px, transparent 9px),
    radial-gradient(circle at 58% 68%, rgba(31,125,66,0.76) 0 6px, transparent 7px),
    rgba(18,82,51,0.56);
  background-size: 42px 42px, 56px 56px, 52px 52px, 46px 46px, auto;
  box-shadow: 0 0 70px rgba(9,59,33,0.68);
}

.terrain-mountains {
  right: -6%;
  top: -8%;
  width: 58%;
  height: 40%;
  background:
    linear-gradient(135deg, transparent 42%, rgba(225,230,224,0.55) 43% 47%, transparent 48%),
    linear-gradient(45deg, transparent 40%, rgba(77,83,88,0.88) 41% 58%, transparent 59%),
    linear-gradient(135deg, transparent 44%, rgba(102,108,112,0.9) 45% 61%, transparent 62%);
  background-size: 78px 78px, 118px 118px, 150px 150px;
  opacity: 0.92;
  filter: drop-shadow(0 18px 24px rgba(0,0,0,0.32));
}

.terrain-village {
  left: 33%;
  top: 36%;
  width: 34%;
  height: 28%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 48%, rgba(217,172,92,0.38), transparent 44%),
    repeating-conic-gradient(from 10deg, rgba(91,58,26,0.34) 0 9deg, transparent 9deg 24deg);
  box-shadow: 0 0 56px rgba(212,175,55,0.22);
}

.terrain-water {
  left: -3%;
  right: -3%;
  bottom: -5%;
  height: 32%;
  background:
    repeating-linear-gradient(170deg, rgba(255,255,255,0.12) 0 2px, transparent 2px 28px),
    linear-gradient(180deg, rgba(34,113,132,0.84), rgba(12,63,96,0.95));
  border-radius: 58% 42% 0 0;
  box-shadow: inset 0 26px 40px rgba(255,255,255,0.08);
}

.terrain-coast {
  left: 4%;
  right: 4%;
  bottom: 25%;
  height: 44px;
  border-radius: 50%;
  background: rgba(220,179,95,0.3);
  filter: blur(8px);
}

.landmark {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  color: var(--gold-soft);
  text-align: center;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,0.42));
}

.landmark-label {
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  transform: translateX(-50%);
  min-width: 112px;
  padding: 4px 7px;
  border: 1px solid rgba(212,175,55,0.34);
  border-radius: 999px;
  background: rgba(4, 10, 18, 0.72);
  color: #f5df99;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  white-space: nowrap;
}

.landmark-great-hall {
  left: 50%;
  top: 50%;
  width: 96px;
  height: 76px;
  transform: translate(-50%, -50%) scale(var(--house-map-scale, 1));
}

.hall-roof {
  position: absolute;
  left: 8px;
  top: 2px;
  width: 80px;
  height: 34px;
  background: linear-gradient(135deg, #6f2d1d, #2b1110 70%);
  clip-path: polygon(50% 0, 100% 80%, 82% 100%, 50% 52%, 18% 100%, 0 80%);
  border-bottom: 3px solid rgba(212,175,55,0.72);
}

.hall-body {
  position: absolute;
  left: 17px;
  top: 31px;
  width: 62px;
  height: 38px;
  border: 2px solid rgba(212,175,55,0.54);
  border-radius: 8px 8px 5px 5px;
  background:
    linear-gradient(90deg, transparent 45%, rgba(212,175,55,0.48) 46% 54%, transparent 55%),
    repeating-linear-gradient(90deg, rgba(94,55,25,0.94) 0 9px, rgba(54,31,18,0.94) 9px 18px);
  box-shadow: inset 0 -10px 16px rgba(0,0,0,0.34), 0 0 24px rgba(212,175,55,0.18);
}

.landmark-docks {
  left: 51%;
  bottom: 13%;
  width: 170px;
  height: 86px;
  transform: translateX(-50%);
}

.dock-pier {
  position: absolute;
  background: repeating-linear-gradient(90deg, #6b4423 0 8px, #3d2919 8px 14px);
  border: 1px solid rgba(242,214,117,0.22);
  box-shadow: 0 8px 12px rgba(0,0,0,0.26);
}

.pier-main {
  left: 72px;
  top: 8px;
  width: 20px;
  height: 66px;
}

.pier-left {
  left: 22px;
  top: 44px;
  width: 62px;
  height: 14px;
}

.pier-right {
  left: 84px;
  top: 44px;
  width: 62px;
  height: 14px;
}

.ship-mark {
  position: absolute;
  right: 8px;
  bottom: 9px;
  width: 50px;
  height: 25px;
  border-bottom: 9px solid rgba(48, 24, 18, 0.95);
  border-radius: 0 0 50px 50px;
}

.ship-mark::before {
  content: "";
  position: absolute;
  left: 23px;
  bottom: 8px;
  width: 2px;
  height: 32px;
  background: rgba(242,214,117,0.76);
}

.ship-mark::after {
  content: "";
  position: absolute;
  left: 25px;
  bottom: 17px;
  width: 22px;
  height: 22px;
  background: rgba(225,213,177,0.72);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.landmark-rune {
  left: 24%;
  top: 25%;
  width: 64px;
  height: 86px;
  transform: translate(-50%, -50%);
}

.rune-stone {
  position: absolute;
  left: 16px;
  top: 6px;
  width: 32px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(176,190,177,0.42);
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(145deg, #7f8a7f, #2d3834 72%);
  color: #f2d675;
  font-size: 21px;
  font-weight: 900;
  box-shadow: inset -6px -10px 16px rgba(0,0,0,0.32);
}

.rune-glow {
  position: absolute;
  left: 2px;
  top: 0;
  width: 60px;
  height: 70px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.28), transparent 64%);
}

.landmark-mine {
  right: 21%;
  top: 23%;
  width: 92px;
  height: 78px;
  transform: translate(50%, -50%);
}

.mine-mouth {
  position: absolute;
  left: 20px;
  top: 10px;
  width: 52px;
  height: 44px;
  border: 5px solid rgba(93,91,84,0.9);
  border-bottom: 0;
  border-radius: 28px 28px 4px 4px;
  background:
    radial-gradient(circle at 50% 100%, rgba(0,0,0,0.96), rgba(18,20,21,0.96) 58%, transparent 60%),
    linear-gradient(145deg, rgba(120,124,119,0.68), rgba(38,42,43,0.78));
}

.mine-track {
  position: absolute;
  left: 11px;
  top: 51px;
  width: 70px;
  height: 20px;
  border-top: 3px solid rgba(155,118,68,0.76);
  border-bottom: 3px solid rgba(155,118,68,0.76);
  transform: perspective(80px) rotateX(28deg);
}

.mine-track::before,
.mine-track::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 3px;
  height: 24px;
  background: rgba(155,118,68,0.74);
}

.mine-track::before { left: 18px; }
.mine-track::after { right: 18px; }

.district {
  border: 1px solid rgba(242,214,117,0.22);
  border-radius: 22px;
  padding: 12px;
  background: rgba(12, 19, 18, 0.32);
  box-shadow: inset 0 0 34px rgba(0,0,0,0.16);
  backdrop-filter: blur(1px);
}

.district h3 {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 4;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(242,214,117,0.24);
  border-radius: 10px;
  background: rgba(5,12,26,0.72);
  color: var(--gold-soft);
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.map-region {
  position: absolute;
  z-index: 2;
}

.region-elderwood {
  left: 5%;
  top: 7%;
  width: 38%;
  height: 38%;
}

.region-iron {
  right: 5%;
  top: 5%;
  width: 48%;
  height: 36%;
}

.region-founders {
  left: 31%;
  top: 36%;
  width: 38%;
  height: 32%;
}

.region-harbor {
  left: 8%;
  bottom: 6%;
  width: 84%;
  height: 30%;
}

.district-iron {
  background:
    repeating-linear-gradient(135deg, rgba(235,238,232,0.15) 0 3px, transparent 3px 34px),
    linear-gradient(135deg, rgba(69,74,79,0.34), rgba(17,24,31,0.18));
}

.district-elder {
  background:
    radial-gradient(circle at 20% 24%, rgba(9,70,41,0.8) 0 9px, transparent 10px),
    radial-gradient(circle at 62% 52%, rgba(20,104,56,0.72) 0 11px, transparent 12px),
    radial-gradient(circle at 82% 28%, rgba(10,78,45,0.72) 0 10px, transparent 11px),
    linear-gradient(135deg, rgba(15,79,49,0.32), rgba(9,33,28,0.16));
  background-size: 72px 72px, 96px 96px, 86px 86px, auto;
}

.district-founders {
  background:
    radial-gradient(circle at 50% 50%, rgba(226,176,91,0.2), transparent 42%),
    repeating-linear-gradient(35deg, rgba(99,62,27,0.2) 0 8px, transparent 8px 36px),
    linear-gradient(135deg, rgba(119,74,31,0.28), rgba(48,34,22,0.18));
}

.district-harbor {
  background:
    linear-gradient(180deg, rgba(218,173,95,0.24) 0 34%, rgba(24,93,116,0.34) 35% 100%),
    repeating-linear-gradient(170deg, rgba(255,255,255,0.12) 0 2px, transparent 2px 24px);
}

.plot-grid {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 170px;
}

.plot-overlay,
.building-layer,
.blueprint-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.plot-overlay {
  z-index: 6;
}

.blueprint-overlay {
  z-index: 5;
  display: none;
}

.blueprint-view .blueprint-overlay {
  display: block;
}

.building-layer {
  z-index: 7;
}

.plot-overlay .plot {
  pointer-events: auto;
}

.plot {
  position: absolute;
  left: var(--plot-x);
  top: var(--plot-y);
  width: 42px;
  height: 48px;
  min-height: 0;
  border-radius: 0;
  border: 1px solid transparent;
  background: transparent;
  color: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0;
  transform: translate(-50%, -50%);
  transition:
    opacity 0.24s ease,
    border-color 0.24s ease,
    background-color 0.24s ease,
    box-shadow 0.24s ease,
    filter 0.24s ease;
  z-index: 3;
  font-size: 0;
  line-height: 1;
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  box-shadow: none;
  opacity: 0;
}

.plot > span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  display: block;
  min-width: 52px;
  transform: translateX(-50%) translateY(4px);
  border: 1px solid rgba(242,214,117,0.55);
  border-radius: 999px;
  background: rgba(5,12,26,0.86);
  color: #f8e9aa;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  padding: 5px 7px;
  pointer-events: none;
  text-transform: uppercase;
  transition: 0.18s ease;
  white-space: nowrap;
}

.plot::after {
  content: attr(data-plot-number);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  min-width: 36px;
  transform: translateX(-50%) translateY(4px);
  border: 1px solid rgba(242,214,117,0.55);
  border-radius: 999px;
  background: rgba(5,12,26,0.86);
  color: #f8e9aa;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  opacity: 0;
  padding: 5px 7px;
  pointer-events: none;
  transition: 0.18s ease;
  white-space: nowrap;
}

.plot:hover {
  transform: translate(-50%, -50%);
  border-color: rgba(242,214,117,0.72);
  z-index: 8;
  opacity: 1;
  box-shadow: 0 0 10px rgba(212,175,55,0.24);
}

.map-section.land-view .plot.available:hover::after,
.map-section.claim-view .plot.available:hover::after,
.plot.selected::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.plot small {
  display: none;
}

.plot.available {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.plot.claimed {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  opacity: 1;
  cursor: pointer;
}

.plot.yours {
  border-color: rgba(255,232,142,0.88);
  background: rgba(212,175,55,0.42);
  opacity: 1;
  box-shadow:
    0 0 18px rgba(212,175,55,0.48),
    inset 0 0 12px rgba(255,232,142,0.2);
}

.plot.selected {
  border-color: rgba(142,198,255,0.96);
  outline: 2px solid rgba(74,144,255,0.82);
  outline-offset: 4px;
  background: rgba(74,144,255,0.22);
  opacity: 1;
  box-shadow:
    0 0 24px rgba(74,144,255,0.86),
    0 0 0 8px rgba(74,144,255,0.14),
    inset 0 0 12px rgba(142,198,255,0.22);
}

.map-section.land-view .plot.available {
  border-color: rgba(242,214,117,0.64);
  opacity: 0.18;
}

.map-section.land-view .plot.available:hover {
  border-color: rgba(242,214,117,0.95);
  background: rgba(212,175,55,0.06);
  opacity: 0.82;
  box-shadow: 0 0 16px rgba(212,175,55,0.3);
}

.map-section.claim-view .plot.available {
  border-color: rgba(242,214,117,0.78);
  opacity: 0.5;
}

.map-section.claim-view .plot.available:hover {
  border-color: rgba(255,237,166,1);
  background: rgba(212,175,55,0.1);
  opacity: 1;
  box-shadow:
    0 0 18px rgba(212,175,55,0.42),
    0 0 0 5px rgba(212,175,55,0.1);
}

.map-section.claim-view .plot.claimed:not(.yours) {
  filter: brightness(0.55) saturate(0.65);
  opacity: 0.42;
}

.plot {
  opacity: 1;
}

.plot > span {
  display: none;
}

.plot::after {
  inset: auto;
  left: 50%;
  top: 50%;
  bottom: auto;
  display: grid;
  min-width: 0;
  width: 100%;
  height: 100%;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(255,244,194,0.82);
  font-size: 10px;
  opacity: 0;
  padding: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.plot.available {
  border-color: rgba(255,255,255,0.86);
  background: linear-gradient(145deg, rgba(255,255,255,0.7), rgba(220,231,244,0.42));
  opacity: 0.62;
  box-shadow:
    0 4px 14px rgba(80,104,135,0.14),
    inset 0 0 12px rgba(255,255,255,0.44);
}

.plot.available::after {
  opacity: 1;
}

.plot.available:hover {
  border-color: rgba(255,237,166,1);
  background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(236,244,255,0.62));
  opacity: 0.95;
  box-shadow:
    0 0 18px rgba(255,255,255,0.52),
    0 0 12px rgba(142,198,255,0.22),
    inset 0 0 12px rgba(255,255,255,0.42);
}

.plot.claimed {
  border-color: rgba(255,218,150,0.62);
  background: rgba(119,67,38,0.62);
  opacity: 0.82;
  cursor: pointer;
}

.plot.claimed::before {
  content: "\2302";
  position: absolute;
  left: 50%;
  top: 7px;
  transform: translateX(-50%);
  z-index: 2;
  display: grid;
  place-items: center;
  color: #fff0b8;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 2px 4px rgba(0,0,0,0.62),
    0 0 9px rgba(212,175,55,0.36);
}

.plot.claimed.house-level-1 {
  border-color: rgba(255,218,150,0.62);
  background: rgba(119,67,38,0.62);
}

.plot.claimed.house-level-1::before {
  font-size: 14px;
}

.plot.claimed.house-level-2 {
  border-color: rgba(255,226,166,0.72);
  background:
    linear-gradient(145deg, rgba(155,90,48,0.68), rgba(101,58,36,0.56));
  box-shadow:
    0 0 14px rgba(255,202,126,0.18),
    inset 0 0 10px rgba(255,231,182,0.16);
}

.plot.claimed.house-level-2::before {
  content: "\2302\00B7";
  font-size: 15px;
}

.plot.claimed.house-level-3 {
  border-color: rgba(255,235,188,0.82);
  background:
    linear-gradient(145deg, rgba(175,104,58,0.72), rgba(122,68,42,0.62));
  box-shadow:
    0 0 18px rgba(255,213,143,0.26),
    inset 0 0 13px rgba(255,237,196,0.2);
}

.plot.claimed.house-level-3::before {
  content: "\2302\25B2";
  font-size: 15px;
  color: #fff4c8;
}

.plot.claimed.house-level-4 {
  border-color: rgba(255,244,204,0.9);
  background:
    linear-gradient(145deg, rgba(198,126,69,0.78), rgba(132,72,45,0.66));
  box-shadow:
    0 0 22px rgba(255,226,166,0.34),
    0 0 0 4px rgba(255,232,142,0.08),
    inset 0 0 15px rgba(255,244,212,0.24);
}

.plot.claimed.house-level-4::before {
  content: "\2302\25C6";
  font-size: 16px;
  color: #fff8dc;
}

.plot.claimed.house-level-5 {
  border-color: rgba(255,250,224,1);
  background:
    linear-gradient(145deg, rgba(224,165,84,0.84), rgba(151,83,48,0.72));
  box-shadow:
    0 0 28px rgba(255,236,174,0.48),
    0 0 0 5px rgba(255,244,194,0.12),
    inset 0 0 18px rgba(255,255,235,0.3);
}

.plot.claimed.house-level-5::before {
  content: "\2726\2302";
  font-size: 16px;
  color: #fffbe8;
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-1 {
  border-color: rgba(255,218,190,0.78);
  background:
    linear-gradient(145deg, rgba(255,238,226,0.66), rgba(194,91,72,0.34));
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-2 {
  border-color: rgba(255,226,166,0.78);
  background:
    linear-gradient(145deg, rgba(255,239,218,0.7), rgba(188,112,64,0.4));
  box-shadow:
    0 5px 16px rgba(92,62,42,0.15),
    0 0 15px rgba(255,214,154,0.28),
    inset 0 0 13px rgba(255,244,218,0.42);
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-3 {
  border-color: rgba(255,235,188,0.88);
  background:
    linear-gradient(145deg, rgba(255,244,224,0.76), rgba(202,130,76,0.46));
  box-shadow:
    0 6px 18px rgba(92,62,42,0.16),
    0 0 18px rgba(255,224,168,0.36),
    inset 0 0 14px rgba(255,248,230,0.48);
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-4 {
  border-color: rgba(255,244,204,0.96);
  background:
    linear-gradient(145deg, rgba(255,250,236,0.82), rgba(215,151,88,0.52));
  box-shadow:
    0 7px 20px rgba(92,62,42,0.18),
    0 0 22px rgba(255,232,176,0.46),
    0 0 0 4px rgba(255,232,142,0.08),
    inset 0 0 15px rgba(255,255,238,0.54);
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-5 {
  border-color: rgba(255,250,224,1);
  background:
    linear-gradient(145deg, rgba(255,255,244,0.9), rgba(229,170,86,0.6));
  box-shadow:
    0 8px 22px rgba(92,62,42,0.2),
    0 0 26px rgba(255,240,190,0.6),
    0 0 0 5px rgba(255,244,194,0.12),
    inset 0 0 17px rgba(255,255,244,0.62);
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-2::before,
.blueprint-view .master-plot-overlay .plot.claimed.house-level-3::before {
  font-size: 21px;
}

.blueprint-view .master-plot-overlay .plot.claimed.house-level-4::before,
.blueprint-view .master-plot-overlay .plot.claimed.house-level-5::before {
  font-size: 22px;
  color: rgba(255,252,226,0.98);
}

.house-map-art {
  position: absolute;
  left: 50%;
  top: 60%;
  width: var(--house-map-width, 64px);
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  object-fit: contain;
  z-index: 5;
  user-select: none;
  filter:
    drop-shadow(0 8px 12px rgba(32,22,12,0.34))
    drop-shadow(0 0 8px rgba(255,238,188,0.24));
}

.house-level-1-map { --house-map-width: 42px; }
.house-level-2-map { --house-map-width: 56px; }
.house-level-3-map { --house-map-width: 74px; }
.house-level-4-map { --house-map-width: 96px; }
.house-level-5-map { --house-map-width: 125px; }

.plot.has-house.yours .house-map-art,
.plot.has-house-map-art.yours .house-map-art {
  filter:
    drop-shadow(0 8px 12px rgba(32,22,12,0.34))
    drop-shadow(0 0 13px rgba(242,214,117,0.76))
    drop-shadow(0 0 24px rgba(242,214,117,0.34));
}

.plot.has-house.selected .house-map-art,
.plot.has-house-map-art.selected .house-map-art {
  filter:
    drop-shadow(0 8px 12px rgba(32,22,12,0.34))
    drop-shadow(0 0 14px rgba(74,144,255,0.92))
    drop-shadow(0 0 28px rgba(242,214,117,0.48));
}

.plot.has-house.yours.selected .house-map-art,
.plot.has-house-map-art.yours.selected .house-map-art {
  filter:
    drop-shadow(0 8px 12px rgba(32,22,12,0.34))
    drop-shadow(0 0 16px rgba(242,214,117,0.92))
    drop-shadow(0 0 28px rgba(74,144,255,0.72));
}

.plot.claimed::after {
  top: auto;
  bottom: 5px;
  height: auto;
  transform: translateX(-50%);
  opacity: 0.74;
}

.plot.yours {
  border-color: rgba(255,232,142,0.95);
  background: rgba(212,175,55,0.72);
  opacity: 1;
  box-shadow:
    0 0 26px rgba(212,175,55,0.66),
    0 0 0 5px rgba(212,175,55,0.12),
    inset 0 0 14px rgba(255,232,142,0.26);
}

.plot.selected {
  border-color: rgba(142,198,255,1);
  background: rgba(74,144,255,0.5);
  opacity: 1;
  box-shadow:
    0 0 26px rgba(74,144,255,0.9),
    0 0 0 8px rgba(74,144,255,0.16),
    inset 0 0 14px rgba(142,198,255,0.28);
}

.plot.has-house,
.plot.has-house.yours,
.plot.has-house.selected,
.plot.has-house.yours.selected,
.blueprint-view .master-plot-overlay .plot.has-house,
.blueprint-view .master-plot-overlay .plot.has-house.yours,
.blueprint-view .master-plot-overlay .plot.has-house.selected,
.blueprint-view .master-plot-overlay .plot.has-house.yours.selected {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: transparent;
  clip-path: none;
  opacity: 1;
  overflow: visible;
  z-index: 32;
}

.plot.has-house.selected,
.plot.has-house.yours.selected,
.blueprint-view .master-plot-overlay .plot.has-house.selected,
.blueprint-view .master-plot-overlay .plot.has-house.yours.selected {
  z-index: 40;
}

.plot.has-house:hover,
.blueprint-view .master-plot-overlay .plot.has-house:hover {
  outline: 0;
}

.plot.has-house:hover .house-map-art,
.blueprint-view .master-plot-overlay .plot.has-house:hover .house-map-art {
  filter:
    drop-shadow(0 8px 12px rgba(32,22,12,0.34))
    drop-shadow(0 0 10px rgba(242,214,117,0.42));
}

.map-section.land-view .plot.available,
.map-section.claim-view .plot.available {
  opacity: 0.62;
}

.map-section.land-view .plot.available:hover,
.map-section.claim-view .plot.available:hover {
  opacity: 0.95;
}

.blueprint-cluster {
  position: absolute;
  left: var(--cluster-x);
  top: var(--cluster-y);
  width: var(--cluster-w);
  height: var(--cluster-h);
  min-width: 96px;
  min-height: 82px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(var(--cluster-color), 0.72);
  border-radius: 50%;
  background: rgba(var(--cluster-color), 0.12);
  box-shadow:
    0 0 28px rgba(var(--cluster-color), 0.28),
    inset 0 0 28px rgba(var(--cluster-color), 0.12);
  color: #fff8d8;
  text-align: center;
}

.blueprint-cluster strong,
.blueprint-cluster span {
  position: relative;
  z-index: 1;
  display: block;
  text-shadow: 0 2px 5px rgba(0,0,0,0.7);
}

.blueprint-cluster strong {
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.blueprint-cluster span {
  max-width: 92px;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.15;
}

.blueprint-plot {
  position: absolute;
  left: var(--plot-x);
  top: var(--plot-y);
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 50%;
  background: rgba(255,255,255,0.58);
  box-shadow: 0 0 8px rgba(255,255,255,0.26);
}

.blueprint-plot::after {
  content: attr(data-plot-number);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: rgba(255,255,255,0.86);
  font-size: 8px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.blueprint-view .blueprint-plot::after {
  opacity: 0.78;
}

.blueprint-free {
  background: rgba(132, 219, 151, 0.72);
}

.blueprint-roads {
  background: rgba(242, 214, 117, 0.78);
}

.blueprint-buildings,
.blueprint-water {
  background: rgba(201, 64, 64, 0.8);
}

.blueprint-zone {
  position: absolute;
  left: var(--zone-x);
  top: var(--zone-y);
  width: 1173px;
  height: 966px;
  --zone-tint: 198,218,241;
  --zone-border: 79,103,134;
  --zone-glow: 120,145,175;
  --zone-label: 29,42,61;
  border: 1px solid rgba(var(--zone-border),0.34);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(238,244,250,0.54)),
    radial-gradient(circle at 50% 50%, rgba(var(--zone-tint),0.2), transparent 64%);
  backdrop-filter: blur(6px) saturate(1.12);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.9),
    inset 0 0 34px rgba(var(--zone-glow),0.1),
    0 24px 64px rgba(var(--zone-glow),0.12);
}

.blueprint-zone-founder_lands {
  --zone-tint: 242,214,117;
  --zone-border: 207,178,92;
  --zone-glow: 212,175,55;
  --zone-label: 72,55,24;
  isolation: isolate;
  overflow: hidden;
}

.blueprint-zone-founder_lands::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("images/map-terrain/terrain-founder-lands.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 1;
  z-index: 0;
  pointer-events: none;
}

.blueprint-zone-harbor_district {
  --zone-tint: 112,176,255;
  --zone-border: 72,132,194;
  --zone-glow: 82,150,220;
  --zone-label: 28,67,110;
}

.blueprint-zone-elderroot_wilds {
  --zone-tint: 94,188,124;
  --zone-border: 70,138,88;
  --zone-glow: 70,150,98;
  --zone-label: 34,83,50;
}

.blueprint-zone-skullpeak_range {
  --zone-tint: 154,163,176;
  --zone-border: 112,124,140;
  --zone-glow: 118,130,148;
  --zone-label: 55,64,78;
}

.blueprint-zone-ravenfjord {
  --zone-tint: 166,218,245;
  --zone-border: 105,161,194;
  --zone-glow: 122,188,225;
  --zone-label: 39,84,114;
}

.blueprint-zone-ashenholm {
  --zone-tint: 178,139,104;
  --zone-border: 138,102,74;
  --zone-glow: 160,118,86;
  --zone-label: 84,58,40;
}

.blueprint-zone-runeblood_valley {
  --zone-tint: 152,52,66;
  --zone-border: 128,48,58;
  --zone-glow: 142,46,58;
  --zone-label: 92,31,40;
}

.blueprint-zone-blackwater_reach {
  --zone-tint: 54,104,82;
  --zone-border: 45,89,70;
  --zone-glow: 50,96,76;
  --zone-label: 31,68,52;
}

.blueprint-zone-ghostwater_isles {
  --zone-tint: 166,204,221;
  --zone-border: 104,147,168;
  --zone-glow: 126,174,198;
  --zone-label: 48,86,105;
}

.blueprint-zone-kingsreach {
  --zone-tint: 201,168,230;
  --zone-border: 166,129,202;
  --zone-glow: 196,154,230;
  --zone-label: 75,49,112;
}

.blueprint-zone header {
  position: absolute;
  left: 22px;
  top: 20px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(var(--zone-border),0.26);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.92), rgba(var(--zone-tint),0.18));
  color: rgb(var(--zone-label));
  box-shadow:
    0 10px 24px rgba(var(--zone-glow),0.11),
    inset 0 0 0 1px rgba(255,255,255,0.74);
}

.blueprint-zone header strong {
  font-size: 16px;
  letter-spacing: 0.2px;
}

.blueprint-zone header span {
  color: rgba(var(--zone-label),0.72);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.blueprint-zone .blueprint-cluster {
  min-width: 0;
  min-height: 0;
  border-width: 1px;
  border-style: dashed;
  border-color: rgba(var(--zone-border),0.3);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.2), rgba(var(--zone-tint),0.08));
  opacity: 0.52;
  z-index: 1;
  box-shadow:
    0 0 20px rgba(var(--zone-glow),0.11),
    inset 0 0 22px rgba(255,255,255,0.28);
}

.blueprint-zone .blueprint-cluster span {
  max-width: none;
  color: rgba(var(--zone-label),0.74);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.3px;
  text-shadow: none;
}

.master-blueprint-plot {
  position: absolute;
  left: var(--plot-x);
  top: var(--plot-y);
  width: 34px;
  height: 39px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255,255,255,0.78);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.56), rgba(232,240,250,0.38));
  backdrop-filter: blur(4px) saturate(1.18);
  color: rgba(37,48,62,0.78);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  clip-path: polygon(50% 0, 94% 24%, 94% 76%, 50% 100%, 6% 76%, 6% 24%);
  box-shadow:
    0 5px 16px rgba(68,92,122,0.13),
    0 0 13px rgba(255,255,255,0.52),
    inset 0 0 13px rgba(255,255,255,0.46),
    inset 0 1px 0 rgba(255,255,255,0.62);
  opacity: 0.76;
}

.master-blueprint-plot::after {
  content: attr(data-plot-number);
  text-shadow:
    0 1px 0 rgba(255,255,255,0.7),
    0 1px 5px rgba(94,112,135,0.18);
}

.master-blueprint-plot:not(.locked) {
  border-color: rgba(255,255,255,0.94);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.66), rgba(237,244,253,0.5));
  color: rgba(24,36,52,0.88);
  box-shadow:
    0 6px 18px rgba(68,92,122,0.16),
    0 0 17px rgba(255,255,255,0.68),
    0 0 8px rgba(198,222,255,0.24),
    inset 0 0 14px rgba(255,255,255,0.56),
    inset 0 1px 0 rgba(255,255,255,0.76);
  opacity: 0.88;
}

.master-blueprint-plot.locked {
  border-color: rgba(255,255,255,0.58);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.44), rgba(226,235,246,0.3));
  color: rgba(60,72,88,0.54);
  box-shadow:
    0 4px 12px rgba(68,92,122,0.09),
    0 0 9px rgba(255,255,255,0.38),
    inset 0 0 10px rgba(255,255,255,0.34);
  opacity: 0.54;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: rgba(5,12,26,0.96);
  border: 1px solid var(--border);
  color: white;
  padding: 16px 18px;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow: visible;
  }

  .app-sidebar {
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid rgba(242,214,117,0.24);
  }

  .world-main {
    width: 100%;
    height: 78vh;
    min-height: 620px;
  }

  .topbar, .map-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dashboard .panel:nth-child(1) { order: 3; }
  .dashboard .panel:nth-child(2) { order: 1; }
  .dashboard .panel:nth-child(3) { order: 2; }

  .map-viewport {
    height: 100%;
    min-height: 0;
  }

  .world-navigation {
    margin-top: 0;
    padding: 8px;
  }

  .world-nav-item {
    min-width: 132px;
    padding: 9px 10px;
  }

  .world-map {
    --world-map-width: 2200px;
  }

  .founder-lands {
    left: 780px;
    top: 470px;
    width: 640px;
    height: 520px;
  }

  .map-region {
    position: absolute;
  }

  .plot-grid {
    max-height: none;
  }
}

@media (max-width: 768px) {
  .topbar,
  .app-sidebar {
    width: 100%;
  }

  .topbar {
    gap: 14px;
    padding: 16px 0;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    font-size: 12px;
  }

  .hero-card,
  .map-section,
  .panel {
    border-radius: 18px;
    padding: 16px;
  }

  .hero-card h2,
  .map-header h2 {
    font-size: 30px;
  }

  .hero-card p {
    font-size: 15px;
  }

  .dashboard {
    gap: 12px;
    margin: 14px 0;
  }

  .estate-ranking-panel {
    border-radius: 18px;
    margin-bottom: 14px;
    padding: 14px;
  }

  .estate-ranking-header {
    flex-direction: column;
    gap: 10px;
  }

  .estate-ranking-header > span {
    width: 100%;
    text-align: center;
  }

  .estate-ranking-row {
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
  }

  .ranking-house,
  .ranking-score {
    grid-column: 2;
    justify-self: start;
  }

  .plot-info-card {
    gap: 10px;
  }

  .plot-info-summary {
    padding: 9px 10px;
  }

  .plot-info-section {
    padding: 9px;
  }

  .estate-banner {
    flex-direction: column;
  }

  .estate-rank-badge {
    width: 100%;
    text-align: center;
  }

  .estate-identity-grid,
  .plot-info-grid {
    grid-template-columns: 1fr;
  }

  .estate-identity-grid div,
  .plot-info-grid div,
  .plot-future-grid span {
    padding: 8px 9px;
  }

  .property-management-btn,
  .upgrade-house-btn {
    padding: 10px;
    white-space: normal;
  }

  .property-management-modal {
    align-items: stretch;
    padding: 10px;
  }

  .estate-detail-modal {
    align-items: stretch;
    padding: 10px;
  }

  .estate-detail-panel {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 14px;
  }

  .estate-detail-header {
    flex-direction: column;
    gap: 12px;
  }

  .estate-detail-grid,
  .estate-detail-actions {
    grid-template-columns: 1fr;
  }

  .valhalla-gate-marker {
    top: 64px;
    padding: 8px 10px;
  }

  .property-management-panel {
    max-height: calc(100vh - 20px);
    border-radius: 18px;
    padding: 14px;
  }

  .property-management-header {
    flex-direction: column;
    gap: 12px;
  }

  .property-close-btn {
    width: 100%;
  }

  .property-management-grid,
  .management-data-grid {
    grid-template-columns: 1fr;
  }

  .future-upgrade-card > div:first-child {
    flex-direction: column;
    gap: 4px;
  }

  .future-upgrade-card dl {
    grid-template-columns: 1fr;
  }

  .property-management-section {
    padding: 11px;
  }

  .management-note,
  .database-note {
    font-size: 10px;
  }

  .world-navigation {
    gap: 8px;
    margin-bottom: 12px;
    padding: 7px;
  }

  .world-nav-item {
    min-width: 124px;
    border-radius: 12px;
    padding: 8px 9px;
  }

  .world-nav-item strong {
    font-size: 11px;
  }

  .world-nav-item span {
    font-size: 10px;
  }

  .legend {
    gap: 9px 12px;
    font-size: 12px;
  }

  .gold-btn,
  .map-toggle-btn {
    width: 100%;
    padding: 12px 14px;
    white-space: normal;
  }

  #connectWalletBtn {
    width: auto;
    max-width: 176px;
    padding: 9px 13px;
    white-space: nowrap;
  }
}

@media (max-width: 520px) {
  .map-section { padding: 14px; }

  .plot-info-grid {
    grid-template-columns: 1fr;
  }

  .map-viewport {
    height: 100%;
    min-height: 0;
  }
}
/* FORCE DESKTOP APP LAYOUT — Wormguard fullscreen shell */

@media (min-width: 1024px) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  body {
    min-height: 100vh;
  }

  .layout {
    width: 100vw !important;
    max-width: none !important;
    height: calc(100vh - 98px) !important;
    margin: 0 !important;
    padding: 0 18px 18px !important;
    display: grid !important;
    grid-template-columns: 360px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    gap: 18px !important;
    align-items: stretch !important;
  }

  .hero-card {
    display: none !important;
  }

  .dashboard {
    grid-column: 1 !important;
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    margin: 0 !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
  }

  .dashboard .panel {
    width: 100% !important;
    min-height: auto !important;
    padding: 16px !important;
  }

  .dashboard .panel:has(#selectedPlot),
  .dashboard .panel.selected-estate-panel {
    flex: 1 1 auto !important;
    min-height: 360px !important;
  }

  .wallet-panel,
  .dashboard .panel:has(#walletAddress) {
    flex: 0 0 auto !important;
  }

  .worm-list {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }

  .worm-card {
    min-width: 0 !important;
    padding: 12px !important;
  }

  .map-section {
    grid-column: 2 !important;
    grid-row: 1 !important;
    height: 100% !important;
    min-height: 0 !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .map-header {
    flex: 0 0 auto !important;
    margin-bottom: 14px !important;
  }

  .map-viewport {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    width: 100% !important;
  }
}
@media (min-width: 1024px) {
  .topbar {
    position: static;
    width: 100%;
    max-width: none;
    padding: 0 0 14px;
    z-index: auto;
    pointer-events: auto;
  }

  .topbar .brand,
  .topbar #connectWalletBtn {
    pointer-events: auto;
  }

  #connectWalletBtn {
    position: fixed;
    top: 12px;
    right: 24px;
    z-index: 9999;
    width: auto !important;
    max-width: 180px !important;
    padding: 10px 16px !important;
  }

  .test-version-badge,
  .test-badge {
    top: 56px !important;
    right: 24px !important;
  }
}
.estate-ranking-panel {
  position: fixed !important;
  top: 80px !important;
  right: 32px !important;
  bottom: 32px !important;
  width: min(460px, calc(100vw - 48px)) !important;
  max-height: calc(100vh - 112px) !important;
  overflow-y: auto !important;
  z-index: 90 !important;
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.55);
}

@media (min-width: 1024px) {
  .app-sidebar {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 12px;
  }

  .topbar {
    flex: 0 0 auto;
    padding-bottom: 10px;
  }

  .dashboard {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    gap: 9px !important;
    overflow: hidden !important;
  }

  .dashboard .panel {
    flex: 0 0 auto;
    min-height: 0 !important;
    padding: 11px !important;
  }

  .dashboard .panel.selected-estate-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .wallet-panel {
    padding: 10px !important;
  }

  .wallet-panel p {
    margin: 0 0 8px;
  }

  .worms-panel {
    max-height: 250px;
    overflow: visible;
  }

  .worm-list {
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    max-height: 196px;
    overflow-y: auto;
  }

  .worm-card {
    padding: 8px 9px !important;
  }

  .plot-info-card {
    gap: 9px;
    margin-bottom: 9px;
  }

  .property-management-btn,
  #claimPlotBtn {
    padding: 9px 11px;
  }

  #connectWalletBtn {
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    padding: 9px 12px !important;
  }
}

.estate-ranking-panel.is-hidden,
.estate-ranking-panel[hidden] {
  display: none !important;
}

/* Founder Lands house visuals: houses replace claimed hex markers. */
.plot.has-house,
.plot.claimed.has-house,
.plot.yours.has-house,
.plot.selected.has-house,
.blueprint-view .master-plot-overlay .plot.has-house,
.blueprint-view .master-plot-overlay .plot.claimed.has-house,
.blueprint-view .master-plot-overlay .plot.yours.has-house,
.blueprint-view .master-plot-overlay .plot.selected.has-house {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  outline: 0 !important;
  color: transparent !important;
  clip-path: none !important;
}

.plot.has-house::before,
.plot.has-house::after,
.plot.has-house .plot-number,
.plot.has-house .plot-label,
.plot.has-house .hex-label {
  display: none !important;
}

.plot.has-house .house-map-art {
  z-index: 5;
  pointer-events: none;
}

.plot.has-house.yours .house-map-art {
  filter:
    drop-shadow(0 5px 8px rgba(32,22,12,0.3))
    drop-shadow(0 0 10px rgba(245,210,90,0.72));
}

.plot.has-house.selected .house-map-art {
  filter:
    drop-shadow(0 5px 8px rgba(32,22,12,0.3))
    drop-shadow(0 0 8px rgba(80,150,255,0.9))
    drop-shadow(0 0 18px rgba(245,210,90,0.45));
}

.plot.has-house.yours.selected .house-map-art {
  filter:
    drop-shadow(0 5px 8px rgba(32,22,12,0.3))
    drop-shadow(0 0 10px rgba(80,150,255,0.85))
    drop-shadow(0 0 16px rgba(245,210,90,0.68));
}

/* Map visual cleanup: real Supabase plots replace planning overlays. */
.blueprint-cluster,
.blueprint-zone .blueprint-cluster,
.master-blueprint-plot {
  display: none !important;
}

.blueprint-zone-founder_lands::before {
  opacity: 1;
}

/* House plots keep their button hit area but display only the house artwork. */
.plot.has-house,
.plot.has-house-map-art,
.plot.claimed.has-house,
.plot.claimed.has-house-map-art,
.plot.yours.has-house,
.plot.yours.has-house-map-art,
.plot.selected.has-house,
.plot.selected.has-house-map-art,
.blueprint-view .master-plot-overlay .plot.has-house,
.blueprint-view .master-plot-overlay .plot.has-house-map-art {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  clip-path: none !important;
  backdrop-filter: none !important;
  opacity: 1;
  overflow: visible;
}

.plot.has-house::before,
.plot.has-house::after,
.plot.has-house-map-art::before,
.plot.has-house-map-art::after,
.plot.has-house > span,
.plot.has-house-map-art > span,
.plot.has-house .plot-number,
.plot.has-house-map-art .plot-number,
.plot.has-house .plot-label,
.plot.has-house-map-art .plot-label,
.plot.has-house .hex-label,
.plot.has-house-map-art .hex-label {
  display: none !important;
}

.plot.has-house .house-map-art,
.plot.has-house-map-art .house-map-art {
  display: block !important;
  z-index: 5;
  pointer-events: none;
}

/* Terrain-readable estate plots */
.blueprint-view .master-plot-overlay .plot.available:not(.has-house):not(.has-house-map-art) {
  border: 2px solid rgba(255,255,255,0.8) !important;
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
  box-shadow:
    0 0 9px rgba(255,255,255,0.2),
    inset 0 0 8px rgba(255,255,255,0.05) !important;
  backdrop-filter: none !important;
  opacity: 1;
  text-shadow:
    0 1px 2px rgba(18,28,42,0.95),
    0 0 5px rgba(18,28,42,0.58);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.blueprint-view .master-plot-overlay .plot.available:not(.has-house):not(.has-house-map-art) .plot-label {
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}

.blueprint-view .master-plot-overlay .plot.available:not(.has-house):not(.has-house-map-art):hover {
  border-color: #e0c15a !important;
  background: rgba(224,193,90,0.18) !important;
  box-shadow:
    0 0 12px rgba(224,193,90,0.52),
    0 0 22px rgba(224,193,90,0.2),
    inset 0 0 8px rgba(255,244,194,0.1) !important;
}

.blueprint-view .master-plot-overlay .plot.available.selected:not(.has-house):not(.has-house-map-art) {
  border-color: #e0c15a !important;
  background: rgba(224,193,90,0.22) !important;
  box-shadow:
    0 0 15px rgba(224,193,90,0.78),
    0 0 30px rgba(224,193,90,0.34),
    inset 0 0 10px rgba(255,244,194,0.14) !important;
}

/* Claimed estates use their house artwork as the complete map marker. */
.blueprint-view .master-plot-overlay .plot.claimed {
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: transparent !important;
  clip-path: none !important;
  backdrop-filter: none !important;
}

.blueprint-view .master-plot-overlay .plot.claimed .plot-label,
.blueprint-view .master-plot-overlay .plot.claimed::before,
.blueprint-view .master-plot-overlay .plot.claimed::after {
  display: none !important;
}

.plot.has-house.selected .house-map-art,
.plot.has-house-map-art.selected .house-map-art,
.plot.has-house.yours.selected .house-map-art,
.plot.has-house-map-art.yours.selected .house-map-art {
  filter:
    drop-shadow(0 6px 9px rgba(32,22,12,0.32))
    drop-shadow(0 0 10px rgba(224,193,90,0.92))
    drop-shadow(0 0 20px rgba(224,193,90,0.48)) !important;
}

/* Estate interaction polish */
.plot.has-house .house-map-art,
.plot.has-house-map-art .house-map-art {
  transform: translate(-50%, -50%) scale(1);
  transform-origin: 50% 70%;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.plot.has-house:not(.selected):hover .house-map-art,
.plot.has-house-map-art:not(.selected):hover .house-map-art {
  transform: translate(-50%, -50%) scale(1.05);
  filter:
    drop-shadow(0 6px 9px rgba(32,22,12,0.32))
    drop-shadow(0 0 12px rgba(224,193,90,0.62)) !important;
}

.estate-detail-panel {
  width: min(900px, 100%);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(224,193,90,0.1), transparent 34%),
    linear-gradient(145deg, rgba(5,12,26,0.98), rgba(10,27,52,0.96));
}

.estate-detail-art[hidden] {
  display: none;
}

.estate-detail-art {
  overflow: hidden;
}

.estate-art-placeholder {
  width: 100%;
  max-width: none;
  background-size: cover;
  background-position: center;
}

.estate-detail-availability {
  margin: 0 0 14px;
  border: 1px solid rgba(224,193,90,0.32);
  border-radius: 14px;
  background: rgba(224,193,90,0.09);
  color: #f8e9aa;
  font-weight: 800;
  padding: 14px;
  text-align: center;
}

.estate-detail-availability[hidden] {
  display: none;
}

.estate-detail-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.estate-detail-actions > button {
  width: 100%;
  min-height: 42px;
  margin: 0;
}

.estate-secondary-btn {
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  background: rgba(255,255,255,0.07);
  color: #f7faff;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 12px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    opacity 160ms ease;
}

.estate-secondary-btn:hover:not(:disabled) {
  border-color: rgba(224,193,90,0.62);
  background: rgba(224,193,90,0.12);
}

.estate-secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

@media (min-width: 1024px) {
  .selected-estate-panel .plot-info-card {
    gap: 7px;
  }

  .selected-estate-panel .estate-compact-summary {
    padding: 8px 10px;
  }
}

@media (max-width: 768px) {
  .estate-detail-actions {
    grid-template-columns: 1fr;
  }

  .estate-art-placeholder {
    height: clamp(190px, 30vh, 300px);
  }

  .worm-list {
    grid-template-columns: 1fr;
    max-height: 240px;
  }
}

.compact-dialog {
  width: min(520px, 100%);
}

.rename-estate-form {
  display: grid;
  gap: 10px;
}

.rename-estate-form label {
  color: rgba(242,214,117,0.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.rename-estate-form input {
  width: 100%;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 12px;
  outline: 0;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font: inherit;
  padding: 12px;
}

.rename-estate-form input:focus {
  border-color: rgba(224,193,90,0.78);
  box-shadow: 0 0 0 3px rgba(224,193,90,0.12);
}

.form-error {
  margin: 0;
  color: #ffb1b1;
  font-size: 12px;
  font-weight: 800;
}

.form-error[hidden] {
  display: none;
}

.system-placeholder-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.system-placeholder-details:empty {
  display: none;
}

.system-placeholder-details div {
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  padding: 10px;
}

.system-placeholder-details span,
.system-placeholder-details strong {
  display: block;
}

.system-placeholder-details span {
  color: rgba(216,226,241,0.66);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.system-placeholder-details strong {
  margin-top: 5px;
  color: #fff7d3;
  font-size: 13px;
}

.system-placeholder-badge {
  margin: 0;
  border: 1px solid rgba(224,193,90,0.34);
  border-radius: 12px;
  background: rgba(224,193,90,0.1);
  color: #f8e9aa;
  font-weight: 900;
  padding: 12px;
  text-align: center;
}

@media (max-width: 520px) {
  .system-placeholder-details {
    grid-template-columns: 1fr;
  }
}

/* Property Management internal views */
.property-modal-view[hidden] {
  display: none !important;
}

.property-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.property-back-btn {
  border: 1px solid rgba(224,193,90,0.44);
  border-radius: 12px;
  background: rgba(224,193,90,0.1);
  color: #f8e9aa;
  cursor: pointer;
  font-weight: 900;
  padding: 10px 12px;
}

.property-back-btn:hover {
  border-color: rgba(224,193,90,0.76);
  background: rgba(224,193,90,0.16);
}

.property-back-btn[hidden] {
  display: none;
}

.property-management-subview {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: stretch;
}

.upgrade-detail-media {
  min-height: 280px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(224,193,90,0.24);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 45%, rgba(224,193,90,0.12), transparent 42%),
    rgba(255,255,255,0.045);
}

.upgrade-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upgrade-detail-media span {
  max-width: 180px;
  color: rgba(248,233,170,0.84);
  font-size: 18px;
  font-weight: 900;
  text-align: center;
}

.upgrade-detail-media.has-image span {
  display: none;
}

.property-subview-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.property-subview-content h3 {
  margin: 0 0 10px;
  color: #fff7d3;
  font-size: clamp(26px, 4vw, 40px);
}

.property-subview-content .management-data-grid {
  margin: 16px 0;
}

.property-future-upgrades-section {
  display: none;
}

/* Upgrade cards with resilient image slots */
.future-upgrade-card {
  grid-template-columns: 76px minmax(0, 1fr);
  column-gap: 10px;
  padding: 9px;
}

.future-upgrade-card .upgrade-card-heading {
  display: contents;
}

.upgrade-card-heading > div:last-child {
  min-width: 0;
  align-self: center;
}

.upgrade-card-media {
  grid-row: 1 / span 3;
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.08), rgba(224,193,90,0.06));
}

.upgrade-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upgrade-card-media span {
  display: none;
  max-width: 68px;
  color: rgba(248,233,170,0.76);
  font-size: 9px;
  line-height: 1.15;
  text-align: center;
}

.future-upgrade-card.uses-upgrade-placeholder .upgrade-card-media span {
  display: block;
}

.future-upgrade-card dl,
.future-upgrade-card button {
  grid-column: 2;
}

.future-upgrade-card dl {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Compact selected Worm details */
.selected-worm-details {
  display: grid;
  gap: 5px;
  margin-top: 0;
  border: 1px solid rgba(224,193,90,0.2);
  border-radius: 12px;
  background: rgba(224,193,90,0.055);
  padding: 8px;
}

.selected-worm-inline {
  margin-top: 2px;
  padding: 8px 10px;
}

.selected-worm-inline dl {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selected-worm-inline [hidden] {
  display: none;
}

.selected-worm-details > span {
  color: rgba(216,226,241,0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.selected-worm-details > strong {
  color: #fff7d3;
  font-size: 13px;
}

.selected-worm-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
}

.selected-worm-details dl div {
  min-width: 0;
}

.selected-worm-details dt {
  color: rgba(216,226,241,0.58);
  font-size: 8px;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-worm-details dd {
  margin: 2px 0 0;
  color: #f7faff;
  font-size: 10px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.selected-worm-details small {
  color: rgba(242,214,117,0.72);
  font-size: 9px;
  font-weight: 800;
}

@media (min-width: 1024px) {
  .worms-panel {
    max-height: 250px;
  }

  .worm-list {
    max-height: 196px;
  }
}

@media (max-width: 768px) {
  .property-header-actions {
    width: 100%;
    flex-direction: column-reverse;
  }

  .property-header-actions button {
    width: 100%;
  }

  .property-management-subview {
    grid-template-columns: 1fr;
  }

  .upgrade-detail-media {
    min-height: 190px;
  }
}

@media (max-width: 520px) {
  .future-upgrade-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .upgrade-card-media {
    width: 64px;
    height: 64px;
  }

  .future-upgrade-card dl {
    grid-template-columns: 1fr;
  }
}
