.ws-map-page{
  display:grid;
  gap:16px;
}

.ws-map-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
  flex-wrap:wrap;
}

.ws-map-sub{margin:0}

.ws-map-pills{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:rgba(255,255,255,.03);
  color:var(--muted);
  font-size:12px;
}

.ws-toolbar{
  display:grid;
  gap:12px;
  grid-template-columns:minmax(0,1fr);
}

.ws-seed-field{
  display:grid;
  gap:8px;
}

.ws-toolbar-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.ws-map-grid{
  display:grid;
  gap:16px;
  grid-template-columns:minmax(0,1fr);
}

.ws-map-stage,
.ws-sidecard{
  min-width:0;
}

.ws-map-frame{
  position:relative;
  height:min(68vh, 720px);
  min-height:460px;
  border:1px solid var(--line);
  border-radius:24px;
  overflow:hidden;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(42,107,255,.11), transparent 60%),
    radial-gradient(800px 520px at 85% 15%, rgba(255,130,60,.08), transparent 58%),
    linear-gradient(180deg, rgba(17,24,38,.98), rgba(11,14,20,.98));
  box-shadow:var(--shadow);
  touch-action:none;
}

#mapCanvas{
  display:block;
  width:100%;
  height:100%;
}

.ws-map-overlay{
  position:absolute;
  left:16px;
  top:16px;
  z-index:4;
  max-width:min(420px, calc(100% - 32px));
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  background:rgba(9,13,20,.72);
  color:var(--muted);
  font-size:12px;
  backdrop-filter:blur(8px);
}

.ws-popup[hidden]{display:none}
.ws-popup{
  position:absolute;
  left:0;
  top:0;
  z-index:6;
  pointer-events:none;
}

.ws-popup__card{
  width:min(280px, calc(100vw - 56px));
  padding:14px;
  border:1px solid rgba(255,255,255,.09);
  border-radius:18px;
  background:rgba(11,14,20,.94);
  box-shadow:0 18px 40px rgba(0,0,0,.44);
  pointer-events:auto;
}

.ws-popup__title{
  font-size:15px;
  font-weight:700;
}

.ws-popup__coords{
  margin-top:6px;
  font-size:13px;
}

.ws-popup__meta{
  margin-top:8px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.ws-popup__build{
  width:100%;
  margin-top:12px;
}

.ws-popup__build[disabled]{
  opacity:.55;
  cursor:not-allowed;
}

.ws-popup__arrow{
  width:16px;
  height:16px;
  margin: -8px auto 0;
  background:rgba(11,14,20,.94);
  border-left:1px solid rgba(255,255,255,.09);
  border-bottom:1px solid rgba(255,255,255,.09);
  transform:rotate(-45deg);
}

.ws-sidecard{
  padding:18px;
  border:1px solid var(--line);
  border-radius:22px;
  background:rgba(255,255,255,.02);
  box-shadow:var(--shadow);
  display:grid;
  gap:16px;
  align-content:start;
}

.ws-sidecard__block{
  padding:14px;
  border:1px solid rgba(255,255,255,.06);
  border-radius:18px;
  background:rgba(255,255,255,.015);
}

.ws-sidecard__label{
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.ws-sidecard__value{
  margin-top:6px;
  font-size:18px;
  font-weight:700;
}

.ws-sidecard__meta{
  margin-top:8px;
  color:var(--muted);
  line-height:1.45;
}

.ws-sidecard__list{
  margin:10px 0 0;
  padding-left:18px;
  color:var(--muted);
  line-height:1.55;
}

@media (min-width: 1100px){
  .ws-map-grid{
    grid-template-columns:minmax(0,1fr) 320px;
    align-items:start;
  }
}

@media (max-width: 720px){
  .ws-map-frame{
    min-height:400px;
    height:58vh;
  }

  .ws-map-overlay{
    font-size:11px;
  }
}

.ws-legend{
  margin-top:10px;
  display:grid;
  gap:8px;
}
.ws-legend__item{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--muted);
  font-size:13px;
}
.ws-legend__swatch{
  width:14px;
  height:14px;
  border-radius:4px;
  border:1px solid rgba(255,255,255,.14);
  flex:0 0 auto;
}
.ws-legend__swatch--crimson{ background:#8E1F23; }
.ws-legend__swatch--warped{ background:#2F7A73; }
.ws-legend__swatch--wastes{ background:#7A4936; }
.ws-legend__swatch--soul{ background:#5D544E; }
.ws-legend__swatch--basalt{ background:#655E64; }
